mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
* [Document] add english document of Checkbox * [Document] add english document of Field * [Document] add english document of NumberKeyboard * [bugfix] NumberKeyboard should not dispaly title when title is empty * [Document] add english document of PasswordInput * [Document] add english document of Radio * [document] add english document of Switch * [bugfix] remove redundent styles in english document * [Document] fix details * fix Switch test cases * [bugfix] Swipe shouid reinitialize when item changes * [new feature] ImagePreview reconstruct
25 lines
474 B
JavaScript
25 lines
474 B
JavaScript
import Vue from 'vue';
|
|
import ImagePreview from './image-preview';
|
|
|
|
let instance;
|
|
|
|
const ImagePreviewConstructor = Vue.extend(ImagePreview);
|
|
|
|
const initInstance = () => {
|
|
instance = new ImagePreviewConstructor({
|
|
el: document.createElement('div')
|
|
});
|
|
document.body.appendChild(instance.$el);
|
|
};
|
|
|
|
const ImagePreviewBox = images => {
|
|
if (!instance) {
|
|
initInstance();
|
|
}
|
|
|
|
instance.images = images;
|
|
instance.value = true;
|
|
};
|
|
|
|
export default ImagePreviewBox;
|