Portage du site sous vuejs #232

Merged
kazhnuz merged 29 commits from vue-remake into master 2023-02-08 12:45:46 +01:00
2 changed files with 31 additions and 12 deletions
Showing only changes of commit 87dbce765e - Show all commits

View file

@ -1,23 +1,28 @@
import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import { createRouter, createWebHistory } from "vue-router";
import HomeView from "../views/HomeView.vue";
import RuleView from "../views/RuleView.vue";
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
name: 'home',
component: HomeView
path: "/",
name: "home",
component: HomeView,
},
{
path: '/about',
name: 'about',
path: "/jdr/:jdr/rules/:category/:filepath",
component: RuleView,
},
{
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')
}
]
})
component: () => import("../views/AboutView.vue"),
},
],
});
export default router
export default router;

14
src/views/RuleView.vue Normal file
View file

@ -0,0 +1,14 @@
<script setup lang="ts">
import MarkdownFile from "../components/MarkdownFile.vue";
import { useRoute } from "vue-router";
const route = useRoute();
const category = route.params.category;
const filepath = route.params.filepath;
</script>
<template>
<main>
<MarkdownFile :path="`rules/${category}/${filepath}`" />
</main>
</template>