Commit 3ba0bbc0 authored by Mac's avatar Mac

1

parent 985a3b31
...@@ -106,24 +106,27 @@ ...@@ -106,24 +106,27 @@
}, },
created() { created() {
if(this.multiple == true){ if(this.multiple == true){
this.value = [] if(this.value!=''){
this.value= this.value.split(',')
}else{
this.value = []
}
} }
console.log(this.value,'value')
}, },
methods: { methods: {
getmorendata(){
console.log('进来了')
},
get_value(val){ // 将数组值转换为以,隔开的字符串 get_value(val){ // 将数组值转换为以,隔开的字符串
if(val || val===0){ if(val || val===0){
if(Array.isArray(val)){ if(Array.isArray(val)){
let chooseAttr = [] let chooseAttr = []
val.forEach(item=>{ val.forEach(item=>{
let choose = this.list.find(temp => { let choose = this.list.find(temp => {
let val_val = this.getValueKeyValue(temp) let val_val = this.getValueKeyValue(temp)
return item === val_val return item === val_val
}) })
chooseAttr.push(choose) console.log(choose,'choose')
chooseAttr.push(choose)
console.log(chooseAttr)
}) })
let values = chooseAttr.map(temp => this.getLabelKeyValue(temp)).join(',') let values = chooseAttr.map(temp => this.getLabelKeyValue(temp)).join(',')
return values return values
...@@ -165,7 +168,10 @@ ...@@ -165,7 +168,10 @@
return this.value === val return this.value === val
} }
}, },
getLabelKeyValue(item){ // 获取label getLabelKeyValue(item){ // 获取label
if(item==undefined){
return
}
return item[this.labelKey] return item[this.labelKey]
}, },
getValueKeyValue(item){ // 获取value getValueKeyValue(item){ // 获取value
......
...@@ -25,15 +25,7 @@ ...@@ -25,15 +25,7 @@
} }
}, },
created() { created() {
console.log(this.CompData,'CompData')
if(this.CompData.OptionValue && this.CompData.OptionValue!=''){
if (Object.keys(this.$refs).length > 0 && this.$refs.ldselect) {
//判断
console.log(this.$refs.ldselect,'ldselect')
;
}
}
}, },
methods:{ methods:{
selectChange(e){ selectChange(e){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment