vue-click-away-listener
Listen for click events that occur somewhere in the document, outside of the element itself.
features
- Small size(3KB).
install
$ npm i vue-click-away-listener
usage
import Vue from 'vue'
import VueClickAwayListener from 'vue-click-away-listener'
let vm = new Vue({
components: {
VueClickAwayListener
},
methods: {
onAway (type) {
console.log(type)
},
onClick (type) {
console.log(type)
}
}
})
vm.$mount('#app')
Div tag wrap default
block
Special tag
inline