diff --git a/web/src/components/many-to-many/index.vue b/web/src/components/many-to-many/index.vue index c6bd225..3157a00 100644 --- a/web/src/components/many-to-many/index.vue +++ b/web/src/components/many-to-many/index.vue @@ -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