1 import { createApp } from "vue";
2 import { createWebHistory, createRouter } from "vue-router";
3 import { createPinia } from "pinia";
5 import { library } from "@fortawesome/fontawesome-svg-core";
6 import { faPlus, faPencil, faTrash } from "@fortawesome/free-solid-svg-icons";
7 import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
9 library.add(faPlus, faPencil, faTrash);
11 import App from "./components/ERM/ERMMain.vue";
13 import { routes } from "./routes";
15 const router = createRouter({ history: createWebHistory(), routes });
17 import { useMainStore } from "./stores/main";
19 import { createI18n } from "vue-i18n";
21 import * as en from "./locales/en.json"; // We could async the load here, see https://vue-i18n.intlify.dev/guide/advanced/lazy.html
22 const languages = { en };
23 const messages = Object.assign(languages);
24 const i18n = createI18n({ locale: "en", messages });
30 .component("font-awesome-icon", FontAwesomeIcon)
32 const mainStore = useMainStore();
33 const { removeMessages } = mainStore;
34 router.beforeEach((to, from) => {
35 removeMessages(); // This will actually flag the messages as displayed already