bug修复: 修复table-selector组件问题
parent
22879cb170
commit
2c576b6c89
|
@ -170,26 +170,26 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value: {
|
// value: {
|
||||||
handler (value, oldVal) {
|
// handler (value, oldVal) {
|
||||||
// 父组件收到input事件后会通过v-model改变value参数的值
|
// // 父组件收到input事件后会通过v-model改变value参数的值
|
||||||
// 然后此处会watch到value的改变,发出change事件
|
// // 然后此处会watch到value的改变,发出change事件
|
||||||
// change事件放在此处发射的好处是,当外部修改value值时,也能够触发form-data-change事件
|
// // change事件放在此处发射的好处是,当外部修改value值时,也能够触发form-data-change事件
|
||||||
this.$emit('change', value)
|
// this.$emit('change', value)
|
||||||
this.$emit('input', value)
|
// this.$emit('input', value)
|
||||||
// 如果值是被外部改变的,则修改本组件的currentValue
|
// // 如果值是被外部改变的,则修改本组件的currentValue
|
||||||
if (Array.isArray(value) && value.length === 0) {
|
// if (Array.isArray(value) && value.length === 0) {
|
||||||
this.currentValue = null
|
// this.currentValue = null
|
||||||
this.multipleSelection = null
|
// this.multipleSelection = null
|
||||||
} else {
|
// } else {
|
||||||
if (value && this.dispatch) {
|
// if (value && this.dispatch) {
|
||||||
this.dispatch('ElFormItem', 'el.form.blur')
|
// this.dispatch('ElFormItem', 'el.form.blur')
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
deep: true,
|
// deep: true,
|
||||||
immediate: true
|
// immediate: true
|
||||||
},
|
// },
|
||||||
multipleSelection: {
|
multipleSelection: {
|
||||||
handler (newValue, oldVal) {
|
handler (newValue, oldVal) {
|
||||||
const { tableConfig } = this._elProps
|
const { tableConfig } = this._elProps
|
||||||
|
@ -203,25 +203,25 @@ export default {
|
||||||
deep: true,
|
deep: true,
|
||||||
immediate: true
|
immediate: true
|
||||||
}
|
}
|
||||||
// currentValue (newValue, oldVal) {
|
currentValue (newValue, oldVal) {
|
||||||
// const { tableConfig } = this._elProps
|
const { tableConfig } = this._elProps
|
||||||
// const { value } = this.dict
|
const { value } = this.dict
|
||||||
// if (newValue) {
|
if (newValue) {
|
||||||
// if (!tableConfig.multiple) {
|
if (!tableConfig.multiple) {
|
||||||
// if (newValue[0]) {
|
if (newValue[0]) {
|
||||||
// this.$emit('input', newValue[0][value])
|
this.$emit('input', newValue[0][value])
|
||||||
// this.$emit('change', newValue[0][value])
|
this.$emit('change', newValue[0][value])
|
||||||
// }
|
}
|
||||||
// } else {
|
} else {
|
||||||
// console.log(newValue)
|
console.log(newValue)
|
||||||
// const result = newValue.map((item) => {
|
const result = newValue.map((item) => {
|
||||||
// return item[value]
|
return item[value]
|
||||||
// })
|
})
|
||||||
// this.$emit('input', result)
|
this.$emit('input', result)
|
||||||
// this.$emit('change', result)
|
this.$emit('change', result)
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
// 给currentValue设置初始值
|
// 给currentValue设置初始值
|
||||||
|
|
Loading…
Reference in New Issue