feat(Sku): add preview-on-click-image prop (#5684)
This commit is contained in:
@@ -91,6 +91,10 @@ export default createComponent({
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
previewOnClickImage: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
@@ -484,6 +488,8 @@ export default createComponent({
|
||||
},
|
||||
|
||||
onPreviewImage(indexImage) {
|
||||
const { previewOnClickImage } = this;
|
||||
|
||||
const index = this.imageList.findIndex(image => image === indexImage);
|
||||
|
||||
const params = {
|
||||
@@ -494,6 +500,10 @@ export default createComponent({
|
||||
|
||||
this.$emit('open-preview', params);
|
||||
|
||||
if (!previewOnClickImage) {
|
||||
return;
|
||||
}
|
||||
|
||||
ImagePreview({
|
||||
images: this.imageList,
|
||||
startPosition: index,
|
||||
|
||||
Reference in New Issue
Block a user