A hook function triggered when clicking outside the component, used like lifecycle hooks.
use yarn
yarn add vue-click-outside-hook
or use npm
npm install vue-click-outside-hook
<script>
import { defineComponent } from 'vue'
import onClickOutside from 'vue-click-outside-hook';
export default defineComponent({
setup() {
onClickOutside(e => {
// after clicking outside the component
// this callback will be triggered
})
}
})
</script>