Dropdown will not trigger @on-click event when set disabled prop to D…
This commit is contained in:
parent
730eba8adb
commit
434db3c909
1 changed files with 2 additions and 7 deletions
|
@ -37,15 +37,10 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleClick () {
|
handleClick () {
|
||||||
|
if (this.disabled) return;
|
||||||
const $parent = findComponentUpward(this, 'Dropdown');
|
const $parent = findComponentUpward(this, 'Dropdown');
|
||||||
const hasChildren = this.$parent && this.$parent.$options.name === 'Dropdown';
|
const hasChildren = this.$parent && this.$parent.$options.name === 'Dropdown';
|
||||||
|
if (hasChildren) {
|
||||||
if (this.disabled) {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
$parent.currentVisible = true;
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
} else if (hasChildren) {
|
|
||||||
this.$parent.$emit('on-haschild-click');
|
this.$parent.$emit('on-haschild-click');
|
||||||
} else {
|
} else {
|
||||||
if ($parent && $parent.$options.name === 'Dropdown') {
|
if ($parent && $parent.$options.name === 'Dropdown') {
|
||||||
|
|
Loading…
Add table
Reference in a new issue