From 2a7685c27448ceafb9cd5bf041bfe5a81a063373 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 11 Jun 2021 15:44:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dvue=E7=A9=BA=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=E5=AF=BC=E8=87=B4=E5=88=A4=E6=96=AD=E5=B8=83=E5=B0=94?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/widget/DeWidget/DeSelect.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/widget/DeWidget/DeSelect.vue b/frontend/src/components/widget/DeWidget/DeSelect.vue index 269f68eee1..57853a8e67 100644 --- a/frontend/src/components/widget/DeWidget/DeSelect.vue +++ b/frontend/src/components/widget/DeWidget/DeSelect.vue @@ -48,13 +48,14 @@ export default { watch: { 'options.attrs.multiple': function(value) { const sourceValue = this.options.value + const sourceValid = !!sourceValue && Object.keys(sourceValue).length > 0 if (value) { - !sourceValue && (this.options.value = []) - sourceValue && !Array.isArray(sourceValue) && (this.options.value = sourceValue.split(',')) + !sourceValid && (this.options.value = []) + sourceValid && !Array.isArray(sourceValue) && (this.options.value = sourceValue.split(',')) !this.inDraw && (this.options.value = []) } else { - !sourceValue && (this.options.value = null) - sourceValue && Array.isArray(sourceValue) && (this.options.value = sourceValue[0]) + !sourceValid && (this.options.value = null) + sourceValid && Array.isArray(sourceValue) && (this.options.value = sourceValue[0]) !this.inDraw && (this.options.value = null) } } @@ -68,7 +69,7 @@ export default { // this.$nextTick(() => { // this.options && this.options.value && this.changeValue(this.options.value) // }) - this.options && this.options.value && this.changeValue(this.options.value) + this.options && this.options.value && Object.keys(this.options.value).length > 0 && this.changeValue(this.options.value) }, methods: { changeValue(value) {