mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
parent
f1d055fb65
commit
074d49c28f
5
.prettierrc
Normal file
5
.prettierrc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"printWidth": 90,
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "none"
|
||||||
|
}
|
@ -175,17 +175,12 @@ VantComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onPreviewImage(event) {
|
onPreviewImage(event) {
|
||||||
|
if (!this.data.previewFullImage) return;
|
||||||
|
|
||||||
const { index } = event.currentTarget.dataset;
|
const { index } = event.currentTarget.dataset;
|
||||||
const { lists } = this.data;
|
const { lists } = this.data;
|
||||||
const item = lists[index];
|
const item = lists[index];
|
||||||
|
|
||||||
this.$emit('click-preview', {
|
|
||||||
url: item.url || item.path,
|
|
||||||
...this.getDetail(index),
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!this.data.previewFullImage) return;
|
|
||||||
|
|
||||||
wx.previewImage({
|
wx.previewImage({
|
||||||
urls: lists
|
urls: lists
|
||||||
.filter((item) => item.isImage)
|
.filter((item) => item.isImage)
|
||||||
@ -196,5 +191,15 @@ VantComponent({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onClickPreview(event) {
|
||||||
|
const { index } = event.currentTarget.dataset;
|
||||||
|
const item = this.data.lists[index];
|
||||||
|
|
||||||
|
this.$emit('click-preview', {
|
||||||
|
...item,
|
||||||
|
...this.getDetail(index),
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
wx:for="{{ lists }}"
|
wx:for="{{ lists }}"
|
||||||
wx:key="index"
|
wx:key="index"
|
||||||
class="van-uploader__preview"
|
class="van-uploader__preview"
|
||||||
|
data-index="{{ index }}"
|
||||||
|
bindtap="onClickPreview"
|
||||||
>
|
>
|
||||||
<image
|
<image
|
||||||
wx:if="{{ item.isImage }}"
|
wx:if="{{ item.isImage }}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user