I remember using the native js is document.body.onclick = function () {}
using vue to add a click event to the root div and try to disappear, but do not know that this method is normal? Don"t you know there"s another way?
<template>
<div @click="none">
<div id="drop-down">
<Dropdown v-if="dd"></Dropdown>
</div>
</div>
</template>
export default {
name: "Blog",
data () {
return {
dd: true
}
},
methods: {
none () {
this.dd = false
}
},