修改了还是有问题

来源: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;


0
1
然冬
第三行 和 第二十一行 router重复定义了
2020-12-11
共1条回复

毕设一课通 高效完成毕业设计(选题/毕设/论文/答辩)

为计算机专业大学生解决“毕业难题”

344 学习 · 606 问题

查看课程