mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 18:14:13 +00:00
directory adjust: delete entry index.js
This commit is contained in:
@@ -1,3 +1,35 @@
|
||||
import ImagePreview from './src/image-preview.js';
|
||||
import Vue from 'vue';
|
||||
import ImagePreview from './image-preview';
|
||||
|
||||
export default ImagePreview;
|
||||
let instance;
|
||||
|
||||
const ImagePreviewConstructor = Vue.extend(ImagePreview);
|
||||
|
||||
const initInstance = () => {
|
||||
/* istanbul ignore if */
|
||||
if (Vue.prototype.$isServer) return;
|
||||
instance = new ImagePreviewConstructor({
|
||||
el: document.createElement('div')
|
||||
});
|
||||
};
|
||||
|
||||
var ImagePreviewBox = images => {
|
||||
/* istanbul ignore if */
|
||||
if (Vue.prototype.$isServer) return;
|
||||
if (!instance) {
|
||||
initInstance();
|
||||
}
|
||||
|
||||
/* istanbul ignore else */
|
||||
if (!instance.value) {
|
||||
instance.images = images;
|
||||
|
||||
document.body.appendChild(instance.$el);
|
||||
|
||||
Vue.nextTick(() => {
|
||||
instance.value = true;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default ImagePreviewBox;
|
||||
|
Reference in New Issue
Block a user