From f5ab26b3d69c49511f92aea51180a58b2a6400f2 Mon Sep 17 00:00:00 2001 From: EVILLT <53422750+eviIIt@users.noreply.github.com> Date: Tue, 11 Feb 2020 20:11:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B7=A8=E7=BB=84=E4=BB=B6=E6=8B=96?= =?UTF-8?q?=E6=8B=BD=E5=9B=BE=E7=89=87=E4=BC=9A=E5=AF=BC=E8=87=B4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=B1=BB=E5=9E=8B=E5=8F=98=E4=B8=BA=E6=95=B0=E7=BB=84?= =?UTF-8?q?=20(#143)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/upload-to-ali.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/upload-to-ali.vue b/src/upload-to-ali.vue index 4940190..5325f27 100644 --- a/src/upload-to-ali.vue +++ b/src/upload-to-ali.vue @@ -281,6 +281,15 @@ export default { return [].concat(this.value).filter(v => !!v) }, set(list) { + /** + * 仅能在 Windows OS 存在 + * 当组件本身已经存在图片的时候, + * 再把一张图片拖进来会将当前的数据格式变更为 `Array`, 即使是没有开启 `multiple` 的情况下, + * 因此在单张图片的情况禁止 `v-model` 同步行为, 防止触发上面的 `get` 变更为数组 + * + * 单张图片不依靠此值来更新值, 在 `async upload()` 那里会触发更新. + */ + if (!this.multiple) return this.$emit('input', list) } },