Corrections after review input
This commit is contained in:
parent
afef4ce7f7
commit
cf753854d1
2 changed files with 11 additions and 1 deletions
|
@ -1,5 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<li :class="classes" @click.stop="select"><slot>{{ showLabel }}</slot></li>
|
<li
|
||||||
|
:class="classes"
|
||||||
|
@click.stop="select"
|
||||||
|
@mousedown.prevent
|
||||||
|
@touchstart.prevent
|
||||||
|
><slot>{{ showLabel }}</slot></li>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import Emitter from '../../mixins/emitter';
|
import Emitter from '../../mixins/emitter';
|
||||||
|
|
|
@ -337,6 +337,7 @@
|
||||||
},
|
},
|
||||||
getOptionData(value){
|
getOptionData(value){
|
||||||
const option = this.flatOptions.find(({componentOptions}) => componentOptions.propsData.value === value);
|
const option = this.flatOptions.find(({componentOptions}) => componentOptions.propsData.value === value);
|
||||||
|
if (!option) return {};
|
||||||
const textContent = option.componentOptions.children.reduce((str, child) => str + (child.text || ''), '');
|
const textContent = option.componentOptions.children.reduce((str, child) => str + (child.text || ''), '');
|
||||||
const label = option.componentOptions.propsData.label || textContent || '';
|
const label = option.componentOptions.propsData.label || textContent || '';
|
||||||
return {
|
return {
|
||||||
|
@ -389,6 +390,7 @@
|
||||||
this.visible = typeof force !== 'undefined' ? force : !this.visible;
|
this.visible = typeof force !== 'undefined' ? force : !this.visible;
|
||||||
if (this.visible){
|
if (this.visible){
|
||||||
this.dropDownWidth = this.$el.getBoundingClientRect().width;
|
this.dropDownWidth = this.$el.getBoundingClientRect().width;
|
||||||
|
this.broadcast('Drop', 'on-update-popper');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
hideMenu () {
|
hideMenu () {
|
||||||
|
@ -598,6 +600,9 @@
|
||||||
if (topOverflowDistance < 0) {
|
if (topOverflowDistance < 0) {
|
||||||
this.$refs.dropdown.$el.scrollTop += topOverflowDistance;
|
this.$refs.dropdown.$el.scrollTop += topOverflowDistance;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
dropVisible(open){
|
||||||
|
this.broadcast('Drop', open ? 'on-update-popper' : 'on-destroy-popper');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue