支持SSR、升级Vue版本和增加新的icon (#40)
* search component add new style * update vue version and support ssr * unit test * add new icon * new icon
This commit is contained in:
@@ -6,12 +6,14 @@ let instance;
|
||||
const ImagePreviewConstructor = Vue.extend(ImagePreview);
|
||||
|
||||
const initInstance = () => {
|
||||
if (Vue.prototype.$isServer) return;
|
||||
instance = new ImagePreviewConstructor({
|
||||
el: document.createElement('div')
|
||||
});
|
||||
};
|
||||
|
||||
var ImagePreviewBox = images => {
|
||||
if (Vue.prototype.$isServer) return;
|
||||
if (!instance) {
|
||||
initInstance();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<transition name="image-fade">
|
||||
<div class="van-image-preview" ref="previewContainer" v-show="value">
|
||||
<van-swipe>
|
||||
<van-swipe-item v-for="item in images">
|
||||
<van-swipe-item v-for="(item, index) in images" :key="index">
|
||||
<img class="van-image-preview__image" @load="handleLoad" :src="item" alt="">
|
||||
</van-swipe-item>
|
||||
</van-swipe>
|
||||
|
||||
Reference in New Issue
Block a user