error: 'A' is not defined (no-undef) at src\main.js:9:28: 组件加载失败
来源:5-1 快速上手 vue-router
默默秋雨
2019-11-09
{ path: ‘/a’, component: A },
{ path: ‘/b’, component: B },
{ path: ‘/hello-world’, component: HelloWorld }加上这段就报错
ERROR Failed to compile with 1 errors 12:33:18
error in ./src/main.js
Module Error (from ./node_modules/eslint-loader/index.js):
error: ‘A’ is not defined (no-undef) at src\main.js:9:28:
7 | Vue.use(Route)
8 | const routes = [
9 | { path: ‘/a’, component: A },
| ^
10 | { path: ‘/b’, component: B },
11 | { path: ‘/hello-world’, component: HelloWorld }
12 | ]
error: ‘B’ is not defined (no-undef) at src\main.js:10:28:
8 | const routes = [
9 | { path: ‘/a’, component: A },
10 | { path: ‘/b’, component: B },
| ^
11 | { path: ‘/hello-world’, component: HelloWorld }
12 | ]
13 | const router = new Route({
error: ‘HelloWorld’ is not defined (no-undef) at src\main.js:11:38:
9 | { path: ‘/a’, component: A },
10 | { path: ‘/b’, component: B },
11 | { path: ‘/hello-world’, component: HelloWorld }
| ^
12 | ]
13 | const router = new Route({
14 | routes
3 errors found.
1回答
-
Sam
2019-11-11
你好,看报错是A组件没有import
022020-02-19
相似问题