Commit 0b916a32809ae76cf2758539a82081daaf03787f

Authored by 梁灏
1 parent ec98f3c3

update Select

examples/routers/select.vue
... ... @@ -18,7 +18,7 @@
18 18 ],
19 19 list: [],
20 20 loading: false,
21   - states: ["Alabama", "Alaska", "Arizona",
  21 + states: ["Al", "Alabama", "Alaska", "Arizona",
22 22 "Arkansas", "California", "Colorado",
23 23 "Connecticut", "Delaware", "Florida",
24 24 "Georgia", "Hawaii", "Idaho", "Illinois",
... ...
src/components/select/select.vue
... ... @@ -27,7 +27,7 @@
27 27 <transition :name="transitionName">
28 28 <Drop v-show="dropVisible" :placement="placement" ref="dropdown">
29 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 31 <ul v-show="loading" :class="[prefixCls + '-loading']">{{ localeLoadingText }}</ul>
32 32 </Drop>
33 33 </transition>
... ... @@ -510,6 +510,12 @@
510 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 519 } else {
514 520 this.query = '';
515 521 }
... ...