Skip to content

Instantly share code, notes, and snippets.

View justsomexanda's full-sized avatar
✈️
Thinking about flying a plane

Fabian Wagner ➖ a6a2f5842 justsomexanda

✈️
Thinking about flying a plane
View GitHub Profile
@justsomexanda
justsomexanda / app.js
Created January 30, 2024 09:41
Vue 3 simple clicked outside directive
app.directive('click-outside', {
mounted(el, binding) {
setTimeout(() => {
const clickHandler = (e) => {
if (window[JSON.stringify(el)]) {
return
}
window[JSON.stringify(el)] = true
if (!el.contains(e.target) && !e.target.classList.contains(binding.arg)) {