add click outside event emitter to dropdown
This commit is contained in:
parent
3537176f98
commit
526a142cac
1 changed files with 5 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
:class="[prefixCls]"
|
:class="[prefixCls]"
|
||||||
v-clickoutside="handleClose"
|
v-clickoutside="onClickoutside"
|
||||||
@mouseenter="handleMouseenter"
|
@mouseenter="handleMouseenter"
|
||||||
@mouseleave="handleMouseleave">
|
@mouseleave="handleMouseleave">
|
||||||
<div :class="[prefixCls + '-rel']" ref="reference" @click="handleClick"><slot></slot></div>
|
<div :class="[prefixCls + '-rel']" ref="reference" @click="handleClick"><slot></slot></div>
|
||||||
|
@ -111,6 +111,10 @@
|
||||||
}, 150);
|
}, 150);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onClickoutside (e) {
|
||||||
|
this.handleClose();
|
||||||
|
if (this.currentVisible) this.$emit('on-clickoutside', e);
|
||||||
|
},
|
||||||
handleClose () {
|
handleClose () {
|
||||||
if (this.trigger === 'custom') return false;
|
if (this.trigger === 'custom') return false;
|
||||||
if (this.trigger !== 'click') {
|
if (this.trigger !== 'click') {
|
||||||
|
|
Loading…
Add table
Reference in a new issue