jy-dblclick-outside
v1.0.0
Published
双击操作非目标区域
Downloads
1
Readme
ClickOutside
Vue click outside directive.
Installation
$ npm install jy-dblclick-outside
Example
<template>
<div>
<div v-dbl-click-outside="hide" @click="toggle">Toggle</div>
<div v-show="opened">test</div>
</div>
</template>
<script>
import DblClickOutside from 'jy-dblclick-outside'
export default {
data () {
return {
opened: false
}
},
methods: {
toggle () {
this.opened = true
},
hide () {
this.opened = false
}
},
// 自定义指令注册
directives: {
DblClickOutside
}
}
</script>