Merge pull request #6263 from musishui/2.0

fixed: 级联组件data中value类型非字符串时,筛选时无法选中筛选的项
This commit is contained in:
debugIsFalse 2019-09-12 11:25:10 +08:00 committed by GitHub
commit ad4558fba3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -207,7 +207,7 @@
for (let i = 0; i < arr.length; i++) {
let item = arr[i];
item.__label = label ? label + ' / ' + item.label : item.label;
item.__value = value ? value + ',' + item.value : item.value;
item.__value = value ? [...value, item.value] : [item.value];
if (item.children && item.children.length) {
getSelections(item.children, item.__label, item.__value);
@ -276,7 +276,7 @@
this.currentValue = this.selected = this.tmpSelected = [];
this.handleClose();
this.emitValue(this.currentValue, oldVal);
// this.$broadcast('on-clear');
// this.$broadcast('on-clear');
this.broadcast('Caspanel', 'on-clear');
},
handleClose () {
@ -328,7 +328,7 @@
this.query = '';
this.$refs.input.currentValue = '';
const oldVal = JSON.stringify(this.currentValue);
this.currentValue = item.value.split(',');
this.currentValue = item.value;
// use setTimeout for #4786, can not use nextTick, because @on-find-selected use nextTick
setTimeout(() => {
this.emitValue(this.currentValue, oldVal);