|
@@ -1,47 +1,63 @@
|
|
-import {createRouter,createWebHistory,createWebHashHistory} from 'vue-router';
|
|
+import {
|
|
|
|
+ createRouter,
|
|
|
|
+ createWebHistory,
|
|
|
|
+ createWebHashHistory,
|
|
|
|
+} from "vue-router";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-import Home from '@/pages/Home.vue';
|
|
+import Home from "../views/Home.vue";
|
|
-import List from '@/pages/List.vue';
|
|
+import List from "../views/List.vue";
|
|
-import My from '@/pages/My.vue';
|
|
+import My from "../views/My.vue";
|
|
-import Detail from '@/pages/Detail.vue';
|
|
+import Detail from "../views/Detail.vue";
|
|
|
|
|
|
const router = createRouter({
|
|
const router = createRouter({
|
|
-
|
|
+
|
|
- history:createWebHistory(),
|
|
+ history: createWebHistory(),
|
|
-
|
|
+
|
|
- routes:[
|
|
+ routes: [
|
|
-
|
|
+
|
|
|
|
+ {
|
|
|
|
+ path: "/",
|
|
|
|
+ redirect: "/home",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ path: "/home",
|
|
|
|
+
|
|
|
|
+ component: Home,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ path: "/list",
|
|
|
|
+ component: List,
|
|
|
|
+ children: [
|
|
{
|
|
{
|
|
- path:'/',
|
|
+
|
|
- redirect:'/home'
|
|
+
|
|
|
|
+ path:'/detail',
|
|
|
|
+ component: Detail,
|
|
|
|
+ name: "xiangqing",
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ props:{
|
|
|
|
+ user:"我的",
|
|
|
|
+ id:"0976"
|
|
|
|
+ }
|
|
},
|
|
},
|
|
- {
|
|
+ ],
|
|
-
|
|
+ },
|
|
- path:'/home',
|
|
+ {
|
|
-
|
|
+ path: "/my",
|
|
- component:Home
|
|
+ component: My,
|
|
- },
|
|
+ name: "wode",
|
|
- {
|
|
+ },
|
|
- path:'/list',
|
|
+ ],
|
|
- component:List,
|
|
|
|
- children:[
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
- path:'detail/:id/:user',
|
|
|
|
- component:Detail,
|
|
|
|
- name:'xiangqing'
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- path:'/my',
|
|
|
|
- component:My,
|
|
|
|
- name:'wode'
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
-export default router;
|
|
+export default router;
|