refactor: change documents location
This commit is contained in:
parent
3c18e0526a
commit
4da2f9cf69
70 changed files with 1157 additions and 1258 deletions
|
|
@ -59,7 +59,7 @@ onMounted(async () => {
|
|||
window.addEventListener("resize", onResize);
|
||||
|
||||
if (typeof route.params.name === "string") {
|
||||
const res = await fetch(`/${route.params.name}.md`);
|
||||
const res = await fetch(`/documents/${route.params.name}.md`);
|
||||
if (res && res.ok) {
|
||||
const pattern = /chapter-(\d+)/;
|
||||
const match = pattern.exec(route.params.name);
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ onMounted(async () => {
|
|||
window.addEventListener("resize", onResize);
|
||||
|
||||
if (typeof route.params.name === "string") {
|
||||
const res = await fetch(`/${route.params.name}.md`);
|
||||
const res = await fetch(`/documents/${route.params.name}.md`);
|
||||
if (res && res.ok) {
|
||||
text.value = await res.text();
|
||||
found.value = true;
|
||||
|
|
|
|||
|
|
@ -19,12 +19,6 @@ const manualRoute = mergeManual.map(
|
|||
);
|
||||
|
||||
const route: RouteRecordRaw[] = [
|
||||
// ...manualRoute,
|
||||
// {
|
||||
// path: "/manual/chapter-1-admin-login",
|
||||
// name: "Manual",
|
||||
// component: () => import("@/modules/01_manual/MainPage.vue"),
|
||||
// },
|
||||
{
|
||||
path: "/manual/:name",
|
||||
name: "Manual",
|
||||
|
|
@ -33,7 +27,6 @@ const route: RouteRecordRaw[] = [
|
|||
const itemExists = manualRoute.some((item) => item.path === to.fullPath);
|
||||
|
||||
if (itemExists) {
|
||||
console.log("Win");
|
||||
next();
|
||||
} else {
|
||||
next({ name: "Error404NotFound" });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue