feat(router): 使用 vue-router

This commit is contained in:
BTMuli
2023-03-05 17:00:45 +08:00
parent a47e0c92c4
commit c42ca01fa7
7 changed files with 75 additions and 2 deletions

9
src/router/index.ts Normal file
View File

@@ -0,0 +1,9 @@
import { createRouter, createWebHistory } from "vue-router";
import routes from "./routes";
const router = createRouter({
history: createWebHistory(),
routes: routes,
});
export default router;

17
src/router/routes.ts Normal file
View File

@@ -0,0 +1,17 @@
import Home from "../pages/Home.vue";
import Config from "../pages/Config.vue";
const routes = [
{
path: "/",
name: "Home",
component: Home,
},
{
path: "/config",
name: "Config",
component: Config,
},
];
export default routes;