diff --git a/examples/routers/select.vue b/examples/routers/select.vue index 7ec70f2..9c85fba 100644 --- a/examples/routers/select.vue +++ b/examples/routers/select.vue @@ -18,7 +18,7 @@ ], list: [], loading: false, - states: ["Alabama", "Alaska", "Arizona", + states: ["Al", "Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", diff --git a/src/components/select/select.vue b/src/components/select/select.vue index 86585ce..6690965 100644 --- a/src/components/select/select.vue +++ b/src/components/select/select.vue @@ -27,7 +27,7 @@ <transition :name="transitionName"> <Drop v-show="dropVisible" :placement="placement" ref="dropdown"> <ul v-show="(notFound && !remote) || (remote && !loading && !options.length)" :class="[prefixCls + '-not-found']"><li>{{ localeNotFoundText }}</li></ul> - <ul v-show="(!notFound && !remote) || (remote && !loading && !notFound)" :class="[prefixCls + '-dropdown-list']" ref="options"><slot></slot></ul> + <ul v-show="(!notFound && !remote) || (remote && !loading && !notFound)" :class="[prefixCls + '-dropdown-list']"><slot></slot></ul> <ul v-show="loading" :class="[prefixCls + '-loading']">{{ localeLoadingText }}</ul> </Drop> </transition> @@ -510,6 +510,12 @@ this.query = child.label === undefined ? child.searchLabel : child.label; } }); + // 如果删除了搜索词,下拉列表也情况了,所以强制调用一次remoteMethod + if (this.remote) { + this.$nextTick(() => { + this.query = model; + }) + } } else { this.query = ''; } -- libgit2 0.21.4