Browse Source

表单组件 修改下拉选择功能

master
邓宏 2 years ago
parent
commit
66ed2e26f7
  1. 13
      uni_modules/d-form/components/d-form/d-form.vue

13
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)
})

Loading…
Cancel
Save