Commit b9541c05ca06c11444db7942127ca4ef81ec25da
1 parent
9cc6213c
update AutoComplete
Showing
2 changed files
with
2 additions
and
1 deletions
Show diff stats
examples/routers/auto-complete.vue
1 | <template> | 1 | <template> |
2 | <div style="margin: 100px;width: 200px;"> | 2 | <div style="margin: 100px;width: 200px;"> |
3 | - <AutoComplete transfer v-model="value" clearable icon="ios-search" :data="data" @on-search="handleSearch" @on-change="hc" :filter-method="fm"> | 3 | + <AutoComplete transfer v-model="value" icon="ios-search" :data="data" @on-search="handleSearch" @on-change="hc" :filter-method="fm"> |
4 | <!--<Option v-for="item in data" :value="item" :label="item" :key="item">--> | 4 | <!--<Option v-for="item in data" :value="item" :label="item" :key="item">--> |
5 | <!--<span style="color: red">{{ item }}</span>--> | 5 | <!--<span style="color: red">{{ item }}</span>--> |
6 | <!--</Option>--> | 6 | <!--</Option>--> |
src/components/auto-complete/auto-complete.vue
@@ -140,6 +140,7 @@ | @@ -140,6 +140,7 @@ | ||
140 | this.$refs.select.visible = false; | 140 | this.$refs.select.visible = false; |
141 | }, | 141 | }, |
142 | handleClear () { | 142 | handleClear () { |
143 | + if (!this.clearable) return; | ||
143 | this.currentValue = ''; | 144 | this.currentValue = ''; |
144 | this.$refs.select.model = ''; | 145 | this.$refs.select.model = ''; |
145 | } | 146 | } |