mirror of
https://github.com/Spythere/pragotron-td2.git
synced 2026-05-03 05:28:14 +00:00
chore: refreshed project
This commit is contained in:
+20
-2
@@ -1,6 +1,24 @@
|
||||
import { createApp } from 'vue';
|
||||
import { createApp, Directive } from 'vue';
|
||||
import App from './App.vue';
|
||||
import router from './router';
|
||||
import { createPinia } from 'pinia';
|
||||
|
||||
createApp(App).use(router).mount('#app');
|
||||
const pinia = createPinia();
|
||||
|
||||
const clickOutsideDirective: Directive = {
|
||||
mounted(el, binding) {
|
||||
el.clickOutsideEvent = (event: Event) => {
|
||||
if (!(el == event.target || el.contains(event.target))) {
|
||||
binding.value();
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener('click', el.clickOutsideEvent);
|
||||
}
|
||||
};
|
||||
|
||||
createApp(App)
|
||||
.use(router)
|
||||
.use(pinia)
|
||||
.directive('click-outside', clickOutsideDirective)
|
||||
.mount('#app');
|
||||
|
||||
Reference in New Issue
Block a user