From 1888b426ff2b6a529f5fdef0f0453dadef71824b Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期三, 17 四月 2024 10:17:38 +0800 Subject: [PATCH] 隐藏多单位的问题 --- src/views/productManage/product/IconCropper.vue | 28 +++++++++++++++++++++------- 1 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/views/productManage/product/IconCropper.vue b/src/views/productManage/product/IconCropper.vue index cc074b0..ee360dc 100644 --- a/src/views/productManage/product/IconCropper.vue +++ b/src/views/productManage/product/IconCropper.vue @@ -127,16 +127,30 @@ fileName: "" } }, - mounted() { - console.log(this.imageUrl) - if (!this.isView && this.imageUrl?.length > 0) { - this.isPreview = true - this.previewImg = this.imageUrl - } else { - this.isPreview = false + computed: { + myIsView() { + return this.isView } }, + watch: { + myIsView() { + this.setImgMethods() + } + }, + mounted() { + console.log(this.imageUrl) + this.setImgMethods() + }, methods: { + // 璁剧疆涓婁紶/鏇存崲鍥剧墖鏄剧ず鏂规硶 + setImgMethods() { + if (!this.isView && this.imageUrl?.length > 0) { + this.isPreview = true + this.previewImg = this.imageUrl + } else { + this.isPreview = false + } + }, // 涓婁紶鎸夐挳 闄愬埗鍥剧墖澶у皬鍜岀被鍨� handleChangeUpload(file, fileList) { const isJPG = file.raw.type === "image/jpeg" || file.raw.type === "image/png" -- Gitblit v1.8.0