...
|
...
|
@@ -36,7 +36,9 @@ export default { |
|
|
return {
|
|
|
imgs: [],
|
|
|
initialIndex: 0,
|
|
|
articleTotal: 0
|
|
|
articleTotal: 0,
|
|
|
imagePreview: null,
|
|
|
isShowPreview: false,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
...
|
...
|
@@ -53,15 +55,38 @@ export default { |
|
|
showAricleImages(e) { // 点击推荐小图展示文章内大图
|
|
|
this.initialIndex = parseInt(e.currentTarget.dataset.index, 10) || 0;
|
|
|
|
|
|
this.$createImagePreview({
|
|
|
this.imagePreview = this.$createImagePreview({
|
|
|
imgs: this.imgs,
|
|
|
initialIndex: this.initialIndex,
|
|
|
loop: false,
|
|
|
speed: 500,
|
|
|
onChange: (i) => {
|
|
|
this.initialIndex = i;
|
|
|
},
|
|
|
onHide: () => {
|
|
|
console.log('hide');
|
|
|
}
|
|
|
}).show();
|
|
|
}, (h) => {
|
|
|
return h('a', {
|
|
|
class: {
|
|
|
'image-preview-custom-close': true
|
|
|
},
|
|
|
slot: 'header',
|
|
|
on: {
|
|
|
click: () => {
|
|
|
if (this.imagePreview) {
|
|
|
this.imagePreview.hide();
|
|
|
this.imagePreview = null;
|
|
|
this.isShowPreview = false;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}, '关 闭',);
|
|
|
});
|
|
|
|
|
|
this.imagePreview.show();
|
|
|
this.isShowPreview = true;
|
|
|
|
|
|
// yas
|
|
|
/**
|
...
|
...
|
@@ -86,6 +111,13 @@ export default { |
|
|
}
|
|
|
});
|
|
|
},
|
|
|
closeImagePreview() {
|
|
|
if (this.imagePreview && this.isShowPreview) {
|
|
|
this.imagePreview.hide();
|
|
|
this.imagePreview = null;
|
|
|
this.isShowPreview = false;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
</script>
|
...
|
...
|
|