fix(pages): adaptation du routeur
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Kazhnuz 2023-10-17 19:47:25 +02:00
parent 6eaea78f67
commit 5e6ab270ce

View file

@ -1,11 +1,7 @@
import { createRouter, createWebHashHistory } from "vue-router";
import HomeView from "../views/HomeView.vue";
import RuleView from "../views/RuleView.vue";
import JdrView from "../views/JdrView.vue";
import FichesView from "../views/FichesView.vue";
import ObjetsView from "../views/ObjetsView.vue";
import EquipView from "../views/EquipView.vue";
import ElementsView from "../views/ElementsView.vue";
import CreaturesView from "../views/CreatureListView.vue";
const router = createRouter({
history: createWebHashHistory(import.meta.env.BASE_URL),
@ -16,39 +12,15 @@ const router = createRouter({
component: HomeView,
},
{
path: "/jdr/:jdr/rules/:category/:filepath",
path: "/pages/:filepath",
component: RuleView,
},
{
path: "/jdr/:jdr/",
component: JdrView,
},
{
path: "/fiches",
component: FichesView,
},
{
path: "/about",
name: "about",
// route level code-splitting
// this generates a separate chunk (About.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import("../views/AboutView.vue"),
},
{
path: "/jdr/:jdr/inventaire/objets/",
component: ObjetsView,
},
{
path: "/jdr/:jdr/inventaire/equipements/",
component: EquipView,
},
{
path: "/jdr/:jdr/elements/",
component: ElementsView,
path: "/creatures/:group",
component: CreaturesView,
},
],
scrollBehavior(to, from, savedPosition) {
scrollBehavior(to) {
if (to.hash) {
return {
el: to.hash,