From 239d52b1c66b519e407a712d05e9f2ba5f853faa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Sun, 11 Dec 2022 21:47:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MdpSelectDictTag/index.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/MdpSelectDictTag/index.vue b/src/components/MdpSelectDictTag/index.vue index 4968a4b0..7cfbf852 100644 --- a/src/components/MdpSelectDictTag/index.vue +++ b/src/components/MdpSelectDictTag/index.vue @@ -16,10 +16,18 @@ components: { }, computed: { currentItem(){ + if(this.myVal===''||this.myVal===null){ + return {id:'',name:'无',className:'info'}; + } if(this.dict){ - return this.dict.find(k=>k.id==this.myVal) + var item= this.dict.find(k=>k.id==this.myVal) + if(item){ + return item + }else{ + return {id:this.myVal,name:this.myVal,className:'info'} + } }else{ - return null; + return {id:this.myVal,name:this.myVal,className:'info'}; } } },