parent
7c4c9d9ce9
commit
e200618755
2 changed files with 17 additions and 10 deletions
|
@ -466,6 +466,20 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ready () {
|
ready () {
|
||||||
|
if (!this.multiple && this.filterable && this.model) {
|
||||||
|
this.findChild((child) => {
|
||||||
|
if (this.model === child.value) {
|
||||||
|
if (child.label) {
|
||||||
|
this.query = child.label;
|
||||||
|
} else if (child.searchLabel) {
|
||||||
|
this.query = child.searchLabel;
|
||||||
|
} else {
|
||||||
|
this.query = child.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.updateOptions(true);
|
this.updateOptions(true);
|
||||||
document.addEventListener('keydown', this.handleKeydown);
|
document.addEventListener('keydown', this.handleKeydown);
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<i-button @click="clear">clear</i-button>
|
|
||||||
<Row>
|
<Row>
|
||||||
<i-col span="12" style="padding-right:10px">
|
<i-col span="12" style="padding-right:10px">
|
||||||
<i-select :model.sync="model11" filterable v-ref:select clearable>
|
<i-select :model.sync="model11" filterable>
|
||||||
<i-option v-for="item in cityList" :value="item.value">{{ item.label }}</i-option>
|
<i-option v-for="item in cityList" :value="item.value">{{ item.label }}</i-option>
|
||||||
</i-select>
|
</i-select>
|
||||||
</i-col>
|
</i-col>
|
||||||
|
@ -43,14 +42,8 @@
|
||||||
label: '重庆市'
|
label: '重庆市'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
model11: '',
|
model11: 'beijing',
|
||||||
model12: []
|
model12: ['beijing', 'shanghai']
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
clear () {
|
|
||||||
// this.$refs.select.setQuery('');
|
|
||||||
this.$refs.select.clearSingleSelect();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue