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 { createRouter, createWebHashHistory } from "vue-router";
import HomeView from "../views/HomeView.vue"; import HomeView from "../views/HomeView.vue";
import RuleView from "../views/RuleView.vue"; import RuleView from "../views/RuleView.vue";
import JdrView from "../views/JdrView.vue"; import CreaturesView from "../views/CreatureListView.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";
const router = createRouter({ const router = createRouter({
history: createWebHashHistory(import.meta.env.BASE_URL), history: createWebHashHistory(import.meta.env.BASE_URL),
@ -16,39 +12,15 @@ const router = createRouter({
component: HomeView, component: HomeView,
}, },
{ {
path: "/jdr/:jdr/rules/:category/:filepath", path: "/pages/:filepath",
component: RuleView, component: RuleView,
}, },
{ {
path: "/jdr/:jdr/", path: "/creatures/:group",
component: JdrView, component: CreaturesView,
},
{
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,
}, },
], ],
scrollBehavior(to, from, savedPosition) { scrollBehavior(to) {
if (to.hash) { if (to.hash) {
return { return {
el: to.hash, el: to.hash,