修复BUG:

修复一对多,多对多组件的bug
pull/66/head
猿小天 2022-06-24 17:03:44 +08:00
parent dc939118c9
commit 890e81cd06
1 changed files with 17 additions and 0 deletions

View File

@ -11,6 +11,10 @@ export default {
props: {
color: {
require: false
},
value: {
type: String,
required: false
}
},
data () {
@ -19,6 +23,19 @@ export default {
key: 'name'
}
},
watch:{
value(nv,ov){
const { row } = this.$parent.scope
const { children } = this.$parent
if (children) {
const valueBinding = this.$parent.valueBinding
this.setValue(row[valueBinding])
this.key = children
} else {
this.setValue([])
}
}
},
created () {
const { row } = this.$parent.scope
const { children } = this.$parent