support Select
support Select
This commit is contained in:
parent
47a7f21dc6
commit
4aec6a66bb
9 changed files with 343 additions and 143 deletions
|
@ -2,7 +2,7 @@
|
|||
<li :class="[prefixCls + '-wrap']" v-show="!hidden">
|
||||
<div :class="[prefixCls + '-title']">{{ label }}</div>
|
||||
<ul>
|
||||
<li :class="[prefixCls]" v-el:options><slot></slot></li>
|
||||
<li :class="[prefixCls]" ref="options"><slot></slot></li>
|
||||
</ul>
|
||||
</li>
|
||||
</template>
|
||||
|
@ -10,6 +10,7 @@
|
|||
const prefixCls = 'ivu-select-group';
|
||||
|
||||
export default {
|
||||
name: 'OptionGroup',
|
||||
props: {
|
||||
label: {
|
||||
type: String,
|
||||
|
@ -25,7 +26,7 @@
|
|||
methods: {
|
||||
queryChange () {
|
||||
this.$nextTick(() => {
|
||||
const options = this.$els.options.querySelectorAll('.ivu-select-item');
|
||||
const options = this.$refs.options.querySelectorAll('.ivu-select-item');
|
||||
let hasVisibleOption = false;
|
||||
for (let i = 0; i < options.length; i++) {
|
||||
if (options[i].style.display !== 'none') {
|
||||
|
@ -37,11 +38,11 @@
|
|||
});
|
||||
}
|
||||
},
|
||||
events: {
|
||||
'on-query-change' () {
|
||||
mounted () {
|
||||
this.$on('on-query-change', () => {
|
||||
this.queryChange();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue