From 66ed2e26f7ea62690bee94d4b87a56512f64c98d Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Mon, 20 Feb 2023 18:32:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E7=BB=84=E4=BB=B6=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E6=8B=89=E9=80=89=E6=8B=A9=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uni_modules/d-form/components/d-form/d-form.vue | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/uni_modules/d-form/components/d-form/d-form.vue b/uni_modules/d-form/components/d-form/d-form.vue index 69a30ff..ea33ed7 100644 --- a/uni_modules/d-form/components/d-form/d-form.vue +++ b/uni_modules/d-form/components/d-form/d-form.vue @@ -327,10 +327,14 @@ import {computeArea} from '@/common/utils' function setPickerCol(columns, value, n){ if(columns.length<=0)return - var v=value[n-1]||0 - if(columns[v]?.children){ - this.setColumnValues(n,columns[v].children) - setPickerCol(columns[v].children, value, ++n) + var v=value[n-1] + if(v){ + for(var i in columns){ + if(columns[i].value==v&&columns[i].children){ + this.setColumnValues(n,columns[i].children) + setPickerCol(columns[i].children, value, ++n) + } + } } } function setPickerVal(columns, value){ @@ -436,6 +440,7 @@ import {computeArea} from '@/common/utils' watch:{ columns(n){ if(this.type=='select'){ + console.log(n[0],this.value) this.$nextTick(()=>{ setPickerCol.bind(this.$refs.picker)(n[0]||[],this.value,1) })