diff --git a/examples/routers/select.vue b/examples/routers/select.vue index cad3a96..0bb9ab6 100644 --- a/examples/routers/select.vue +++ b/examples/routers/select.vue @@ -1,9 +1,8 @@ <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> @@ -11,10 +10,26 @@ 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> \ No newline at end of file diff --git a/src/components/select/select.vue b/src/components/select/select.vue index ee27eb7..8fac874 100644 --- a/src/components/select/select.vue +++ b/src/components/select/select.vue @@ -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); }); -- libgit2 0.21.4