Commit 0b916a32809ae76cf2758539a82081daaf03787f
1 parent
ec98f3c3
update Select
Showing
2 changed files
with
8 additions
and
2 deletions
Show diff stats
examples/routers/select.vue
@@ -18,7 +18,7 @@ | @@ -18,7 +18,7 @@ | ||
18 | ], | 18 | ], |
19 | list: [], | 19 | list: [], |
20 | loading: false, | 20 | loading: false, |
21 | - states: ["Alabama", "Alaska", "Arizona", | 21 | + states: ["Al", "Alabama", "Alaska", "Arizona", |
22 | "Arkansas", "California", "Colorado", | 22 | "Arkansas", "California", "Colorado", |
23 | "Connecticut", "Delaware", "Florida", | 23 | "Connecticut", "Delaware", "Florida", |
24 | "Georgia", "Hawaii", "Idaho", "Illinois", | 24 | "Georgia", "Hawaii", "Idaho", "Illinois", |
src/components/select/select.vue
@@ -27,7 +27,7 @@ | @@ -27,7 +27,7 @@ | ||
27 | <transition :name="transitionName"> | 27 | <transition :name="transitionName"> |
28 | <Drop v-show="dropVisible" :placement="placement" ref="dropdown"> | 28 | <Drop v-show="dropVisible" :placement="placement" ref="dropdown"> |
29 | <ul v-show="(notFound && !remote) || (remote && !loading && !options.length)" :class="[prefixCls + '-not-found']"><li>{{ localeNotFoundText }}</li></ul> | 29 | <ul v-show="(notFound && !remote) || (remote && !loading && !options.length)" :class="[prefixCls + '-not-found']"><li>{{ localeNotFoundText }}</li></ul> |
30 | - <ul v-show="(!notFound && !remote) || (remote && !loading && !notFound)" :class="[prefixCls + '-dropdown-list']" ref="options"><slot></slot></ul> | 30 | + <ul v-show="(!notFound && !remote) || (remote && !loading && !notFound)" :class="[prefixCls + '-dropdown-list']"><slot></slot></ul> |
31 | <ul v-show="loading" :class="[prefixCls + '-loading']">{{ localeLoadingText }}</ul> | 31 | <ul v-show="loading" :class="[prefixCls + '-loading']">{{ localeLoadingText }}</ul> |
32 | </Drop> | 32 | </Drop> |
33 | </transition> | 33 | </transition> |
@@ -510,6 +510,12 @@ | @@ -510,6 +510,12 @@ | ||
510 | this.query = child.label === undefined ? child.searchLabel : child.label; | 510 | this.query = child.label === undefined ? child.searchLabel : child.label; |
511 | } | 511 | } |
512 | }); | 512 | }); |
513 | + // 如果删除了搜索词,下拉列表也情况了,所以强制调用一次remoteMethod | ||
514 | + if (this.remote) { | ||
515 | + this.$nextTick(() => { | ||
516 | + this.query = model; | ||
517 | + }) | ||
518 | + } | ||
513 | } else { | 519 | } else { |
514 | this.query = ''; | 520 | this.query = ''; |
515 | } | 521 | } |