我正在使用 element-ui 和 vuejs。我有一个看起来像这样的选择元素
<el-form-item label="City" prop="city">
<el-select
v-model="form.city"
multiple
filterable
remote
auto-complete = "address-level2"
no-match-text = "No data found"
:remote-method = "remoteMethod"
:loading = "loading"
placeholder="Select City">
<el-option
v-for = "(item,index) in cities"
:key = "index"
:label = "item.name"
:value = "item.key"
></el-option>
</el-select>
</el-form-item>
现在我想在用户选择一个选项后触发此选择的模糊事件,以便下拉选项折叠。
这是我的远程方法
remoteMethod: _.throttle(function(query) {
this.loading = true;
axios({
method: 'get',
url: someUrl
}).then(response =>{
if(response.data.status === false){
this.$notify.error({
title: 'Error',
message: response.data.message
});
}
else if(response.data.status === true && response.data.data.length != 0){
this.loading = false;
this.cities = response.data.data;
}
})
}, 1500),