Skip to content

Commit

Permalink
fixed #805
Browse files Browse the repository at this point in the history
  • Loading branch information
icarusion committed Apr 28, 2017
1 parent bb1f58e commit f4c38b4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
29 changes: 22 additions & 7 deletions examples/routers/select.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
<template>
<div style="width: 200px;margin: 100px;">
<Select v-model="fields.pid" filterable placement="top">
<Option :value="0" label="一级菜单"></Option>
<Option :value="1" label="二级菜单"></Option>
</Select>
<i-select v-model="model" filterable clearable style="width:200px">
<i-option :value="option.value" v-for="option in options" :key="option">{{option.label}}</i-option>
</i-select>
</div>
</template>

<script>
export default {
data () {
return {
fields: {
pid: 0
}
model: 1,
options: [
]
}
},
mounted () {
this.options = [{
label: '全部',
value: 0
},{
label: '苹果',
value: 1
},{
label: '香蕉',
value: 2
},{
label: '西瓜',
value: 3
}];
}
}
</script>
6 changes: 6 additions & 0 deletions src/components/select/select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -536,11 +536,17 @@
this.$on('append', () => {
this.modelToQuery();
this.$nextTick(() => {
this.broadcastQuery('');
});
this.slotChange();
this.updateOptions(true, true);
});
this.$on('remove', () => {
this.modelToQuery();
this.$nextTick(() => {
this.broadcastQuery('');
});
this.slotChange();
this.updateOptions(true, true);
});
Expand Down

0 comments on commit f4c38b4

Please sign in to comment.