< FormItem label= "responsible person:" prop= "chargeUserId" >
<Select v-model="cubForm.chargeUserId"
filterable clearable remote :remote-method="remoteMethod2"
:loading="loading2">
<Option v-for="item in userList" :key="item.id" :value="item.id" :label="item.name"
style="width: 250px">
</Option>
</Select>
< / FormItem >
remoteMethod2(query) {
let self = this;
if (query) {
self.loading2 = true;
let params = {
name: query
}
this.$api.get("/user/search", {params: params}).then(function (res) {
if (res.data.code === 200) {
self.userList = res.data.data.list;
} else {
self.$Message.error("" + res.data.code);
}
})
this.loading2 = false;
}
},
userListpush
select select"nishuo"