From 5f7e4c45db94dfaa880a7b2a91699703eea6c007 Mon Sep 17 00:00:00 2001 From: huangdeliang Date: Fri, 19 Mar 2021 10:55:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E9=A2=84=E8=A7=88=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/custom/ingredient/index.vue | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/stdiet-ui/src/views/custom/ingredient/index.vue b/stdiet-ui/src/views/custom/ingredient/index.vue index 37e214f60..8bac238f2 100644 --- a/stdiet-ui/src/views/custom/ingredient/index.vue +++ b/stdiet-ui/src/views/custom/ingredient/index.vue @@ -352,6 +352,7 @@ :on-success="handleOnUploadSuccess" :on-exceed="handleOnUploadExceed" :on-remove="handleOnUploadRemove" + :on-preview="handleOnUploadPreview" list-type="picture" > @@ -408,6 +409,17 @@ 取 消 + + + +
+ +
+
@@ -437,6 +449,7 @@ export default { return { // 遮罩层 loading: true, + // actionUrl: process.env.VUE_APP_BASE_API + "/custom/fileUpload/ingredient", // 选中数组 @@ -480,6 +493,10 @@ export default { form: {}, // 表单校验 rules: {}, + // + previewVisible: false, + previewUrl: "", + previewTitle: "", }; }, created() { @@ -704,6 +721,23 @@ export default { type: "warning", }); }, + handleOnUploadPreview(file) { + console.log(file); + this.previewTitle = file.name; + this.previewVisible = true; + this.previewUrl = file.url; + }, }, }; +