mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 11:17:41 +00:00
feat(Uploader): add click-preview event (#4206)
This commit is contained in:
@@ -193,13 +193,22 @@ export default createComponent({
|
||||
});
|
||||
},
|
||||
|
||||
onClickPreview(file) {
|
||||
this.$emit('click-preview', file, this.detail);
|
||||
},
|
||||
|
||||
renderPreview() {
|
||||
if (!this.previewImage) {
|
||||
return;
|
||||
}
|
||||
|
||||
return this.fileList.map((item, index) => (
|
||||
<div class={bem('preview')}>
|
||||
<div
|
||||
class={bem('preview')}
|
||||
onClick={() => {
|
||||
this.onClickPreview(item);
|
||||
}}
|
||||
>
|
||||
{isImageFile(item) ? (
|
||||
<Image
|
||||
fit={this.imageFit}
|
||||
|
Reference in New Issue
Block a user