mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
Zmiana instancji store'a na Pinia
This commit is contained in:
+11
-14
@@ -1,13 +1,12 @@
|
||||
import { createApp, Directive, ref } from 'vue'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import { store, key } from './store'
|
||||
import { createApp, Directive, ref } from 'vue';
|
||||
import App from './App.vue';
|
||||
import router from './router';
|
||||
|
||||
import enLang from '@/locales/en.json';
|
||||
import plLang from '@/locales/pl.json';
|
||||
|
||||
import { createI18n } from 'vue-i18n'
|
||||
|
||||
import { createI18n } from 'vue-i18n';
|
||||
import { createPinia } from 'pinia';
|
||||
|
||||
const i18n = createI18n({
|
||||
locale: 'pl',
|
||||
@@ -17,26 +16,24 @@ const i18n = createI18n({
|
||||
pl: plLang,
|
||||
},
|
||||
enableLegacy: false,
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
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);
|
||||
document.addEventListener('click', el.clickOutsideEvent);
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
createApp(App)
|
||||
.provide('isFilterCardVisible', ref(false))
|
||||
.use(store, key)
|
||||
.provide('isFilterCardVisible', ref(false))
|
||||
.use(createPinia())
|
||||
.use(router)
|
||||
.use(i18n)
|
||||
.directive('click-outside', clickOutsideDirective)
|
||||
.mount('#app')
|
||||
.mount('#app');
|
||||
|
||||
Reference in New Issue
Block a user