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

0
2
qq_慕码人2412777
VSCODE 软件
2020-02-19
共2条回复

零基础入门 实战mpvue2.0多端小程序框架

mpvue,一套代码搞定多个平台小程序,前端更易上手

819 学习 · 647 问题

查看课程