| | |
| | | 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" |