保存进度!

This commit is contained in:
2022-11-24 15:27:17 +08:00
parent c5e743706d
commit fe9ac2e09a
4 changed files with 48 additions and 17 deletions

View File

@@ -2,7 +2,7 @@
* @Author: Kane
* @Date: 2022-11-24 01:13:55
* @LastEditors: Kane
* @LastEditTime: 2022-11-24 01:34:13
* @LastEditTime: 2022-11-24 09:59:55
* @FilePath: \hello-router\src\main.js
* @Description:
*
@@ -10,24 +10,23 @@
*/
import { createApp } from "vue";
import { createRouter, createWebHashHistory } from "vue-router";
import { createRouter, createWebHashHistory } from 'vue-router';
import App from "./App.vue";
import Demo1 from "./components/功能页面/demo-1.vue";
import Demo2 from "./components/功能页面/demo-2.vue";
import demo1 from "./components/功能页面/demo-1.vue";
import demo2 from "./components/功能页面/demo-2.vue";
import rg from "./components/功能页面/路由守卫.vue";
const app = createApp(App);
//定义路由
const routes = [
{ path: "/demo-1", component: Demo1 },
{ path: "/demo-2", component: Demo2 },
{ path: "/demo-1", component: demo1 },
{ path: "/demo-2", component: demo2 },
{ path: "/user/:username", component: rg }
];
//创建路由对象
const router = createRouter({
history: createWebHashHistory(),
routes: routes
});
})
app.use(router);
app.mount("#app");