mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
32 lines
730 B
TypeScript
32 lines
730 B
TypeScript
import { createApp, Directive, ref } from 'vue';
|
|
import App from './App.vue';
|
|
import router from './router';
|
|
|
|
import i18n from './i18n';
|
|
|
|
import { createPinia } from 'pinia';
|
|
import useCustomSW from './mixins/useCustomSW';
|
|
|
|
// Service worker
|
|
useCustomSW();
|
|
|
|
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)
|
|
.provide('isFilterCardVisible', ref(false))
|
|
.use(createPinia())
|
|
.use(router)
|
|
.use(i18n)
|
|
.directive('click-outside', clickOutsideDirective)
|
|
.mount('#app');
|