Merge pull request #179 from rijn/178

fixed #178
This commit is contained in:
Aresn 2017-01-09 16:13:57 +08:00 committed by GitHub
commit 540e839c8b
2 changed files with 13 additions and 17 deletions

View file

@ -447,7 +447,7 @@
if (model !== '') {
this.findChild((child) => {
if (child.value === model) {
this.query = child.searchLabel;
this.query = child.label === undefined ? child.searchLabel : child.label;
}
});
}
@ -574,7 +574,7 @@
if (this.filterable) {
this.findChild((child) => {
if (child.value === value) {
this.query = child.searchLabel;
this.query = child.label === undefined ? child.searchLabel : child.label;
}
});
}

View file

@ -2,12 +2,12 @@
<Row>
<i-col span="12" style="padding-right:10px">
<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" :label="item.label"><span>{{ item.label }}</span><span>{{ item.des }}</span></i-option>
</i-select>
</i-col>
<i-col span="12">
<i-select :model.sync="model12" filterable multiple>
<i-option v-for="item in cityList" :value="item.value">{{ item.label }}</i-option>
<i-option v-for="item in cityList" :value="item.value" :label="item.label"><span>{{ item.label }}</span><span>{{ item.des }}</span></i-option>
</i-select>
</i-col>
</Row>
@ -19,30 +19,26 @@
cityList: [
{
value: 'beijing',
label: '北京市'
label: '北京市',
des: '帝都'
},
{
value: 'shanghai',
label: '上海市'
label: '上海市',
des: '魔都'
},
{
value: 'shenzhen',
label: '深圳市'
},
{
value: 'hangzhou',
label: '杭州市'
},
{
value: 'nanjing',
label: '南京市'
label: '深圳市',
des: '渔村'
},
{
value: 'chongqing',
label: '重庆市'
label: '重庆市',
des: '山城'
}
],
model11: 'beijing',
model11: '',
model12: ['beijing', 'shanghai']
}
}