Koha/koha-tmpl/intranet-tmpl/prog/js/vue/main-erm.ts
Jonathan Druart 08ce593bd9
Bug 32030: Use fetch.js, improve messages handling, remove top level modules
Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-11-08 09:43:49 -03:00

28 lines
903 B
TypeScript

import { createApp } from "vue";
import { createWebHistory, createRouter } from "vue-router";
import { createPinia } from "pinia";
import { library } from "@fortawesome/fontawesome-svg-core";
import { faPlus, faPencil, faTrash } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
library.add(faPlus, faPencil, faTrash);
import App from "./components/ERM/ERMMain.vue";
import { routes } from "./routes";
const router = createRouter({ history: createWebHistory(), routes });
import { useMainStore } from "./stores/main";
createApp(App)
.use(createPinia())
.use(router)
.component("font-awesome-icon", FontAwesomeIcon)
.mount("#erm");
const mainStore = useMainStore();
const { removeMessages } = mainStore;
router.beforeEach((to, from) => {
removeMessages(); // This will actually flag the messages as displayed already
});