修改了还是有问题
来源:4-1 认证模块前端实现(一)

qq_蓝骏毅_04076633
2020-12-10
ERROR Failed to compile with 1 errors20:59:28
error in ./src/router/index.js
Syntax Error: SyntaxError: C:\Users\pc\Desktop\projects\book-mgr\book-mgr-fe\src\router\index.js: Identifier ‘router’ has already been declared (19:6)
17 | ];
18 |
19 | const router = createRouter({
| ^
20 | history: createWebHashHistory(),
21 | routes,
22 | });
@ ./src/main.js 7:0-30 9:30-36
@ multi (webpack)-dev-server/client?http://192.168.31.85:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
写回答
1回答
-
qq_蓝骏毅_04076633
提问者
2020-12-10
import { createRouter, createWebHashHistory } from 'vue-router'; //import Home from '../views/Home.vue'; import router from './router' const routes = [ { path: '/auth', name: 'Auth', component: () => import(/* webpackChunkName: "auth" */ '../views/Auth/index.vue'), }, // path: '/auth', // name: 'Home', // component: () => import(/* webpackChunkName: "auth" */ '../views/Auth/About.vue'), // }, ]; const router = createRouter({ history: createWebHashHistory(), routes, }); export default router;
012020-12-11
相似问题