fixed #159
This commit is contained in:
梁灏 2017-01-03 12:05:25 +08:00
parent 7c4c9d9ce9
commit e200618755
2 changed files with 17 additions and 10 deletions

View file

@ -466,6 +466,20 @@
}
},
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);
document.addEventListener('keydown', this.handleKeydown);

View file

@ -1,8 +1,7 @@
<template>
<i-button @click="clear">clear</i-button>
<Row>
<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-select>
</i-col>
@ -43,14 +42,8 @@
label: '重庆市'
}
],
model11: '',
model12: []
}
},
methods: {
clear () {
// this.$refs.select.setQuery('');
this.$refs.select.clearSingleSelect();
model11: 'beijing',
model12: ['beijing', 'shanghai']
}
}
}