update Select

This commit is contained in:
梁灏 2017-05-08 10:21:33 +08:00
parent ec98f3c3ae
commit 0b916a3280
2 changed files with 8 additions and 2 deletions

View file

@ -18,7 +18,7 @@
], ],
list: [], list: [],
loading: false, loading: false,
states: ["Alabama", "Alaska", "Arizona", states: ["Al", "Alabama", "Alaska", "Arizona",
"Arkansas", "California", "Colorado", "Arkansas", "California", "Colorado",
"Connecticut", "Delaware", "Florida", "Connecticut", "Delaware", "Florida",
"Georgia", "Hawaii", "Idaho", "Illinois", "Georgia", "Hawaii", "Idaho", "Illinois",

View file

@ -27,7 +27,7 @@
<transition :name="transitionName"> <transition :name="transitionName">
<Drop v-show="dropVisible" :placement="placement" ref="dropdown"> <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 && !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> <ul v-show="loading" :class="[prefixCls + '-loading']">{{ localeLoadingText }}</ul>
</Drop> </Drop>
</transition> </transition>
@ -510,6 +510,12 @@
this.query = child.label === undefined ? child.searchLabel : child.label; this.query = child.label === undefined ? child.searchLabel : child.label;
} }
}); });
// remoteMethod
if (this.remote) {
this.$nextTick(() => {
this.query = model;
})
}
} else { } else {
this.query = ''; this.query = '';
} }