update Select
This commit is contained in:
parent
f10b27f99d
commit
7dcfe45d1b
2 changed files with 13 additions and 6 deletions
|
@ -2,8 +2,8 @@
|
||||||
<Row>
|
<Row>
|
||||||
<i-col span="4">{{model}}</i-col>
|
<i-col span="4">{{model}}</i-col>
|
||||||
<i-col span="8">
|
<i-col span="8">
|
||||||
<i-select v-model="model" multiple filterable remote :remote-method="remoteMethod" :loading="loading" clearable>
|
<i-select v-model="model" @input="handleInput" multiple filterable remote :remote-method="remoteMethod" :loading="loading" clearable>
|
||||||
<i-option v-for="option in options" :value="option.value" :key="option">{{option.label}}</i-option>
|
<i-option v-for="option in options" :value="option.value" :key="new Date()">{{option.label}}</i-option>
|
||||||
</i-select>
|
</i-select>
|
||||||
</i-col>
|
</i-col>
|
||||||
</Row>
|
</Row>
|
||||||
|
@ -82,10 +82,13 @@
|
||||||
return item.label.toLowerCase()
|
return item.label.toLowerCase()
|
||||||
.indexOf(query.toLowerCase()) > -1;
|
.indexOf(query.toLowerCase()) > -1;
|
||||||
});
|
});
|
||||||
}, 200);
|
}, 500);
|
||||||
} else {
|
} else {
|
||||||
this.options = [];
|
this.options = [];
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
handleInput () {
|
||||||
|
// console.log(1)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
|
|
@ -222,9 +222,12 @@
|
||||||
cb(child);
|
cb(child);
|
||||||
} else if (child.$children.length) {
|
} else if (child.$children.length) {
|
||||||
_this.$nextTick(() => {
|
_this.$nextTick(() => {
|
||||||
child.$children.forEach((innerChild) => {
|
// child.$children.forEach((innerChild) => {
|
||||||
find(innerChild, cb);
|
// find(innerChild, cb);
|
||||||
});
|
// });
|
||||||
|
});
|
||||||
|
child.$children.forEach((innerChild) => {
|
||||||
|
find(innerChild, cb);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -300,6 +303,7 @@
|
||||||
},
|
},
|
||||||
updateMultipleSelected (init = false, slot = false) {
|
updateMultipleSelected (init = false, slot = false) {
|
||||||
if (this.multiple && Array.isArray(this.model)) {
|
if (this.multiple && Array.isArray(this.model)) {
|
||||||
|
// todo 这里的 label 有问题,另删除字符时也有问题
|
||||||
let selected = this.remote ? this.selectedMultiple : [];
|
let selected = this.remote ? this.selectedMultiple : [];
|
||||||
|
|
||||||
for (let i = 0; i < this.model.length; i++) {
|
for (let i = 0; i < this.model.length; i++) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue