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