component路径写法错误,[vue-router] route config "component" for path: /content cannot be a string id.
原因:compontent因为不正确。 错误写法:
routes: [
{
//路由路径
path: '/content',
name: 'content',
//跳转的路径
component: 'Content'//错误写法,不能加引号
},
{
//路由路径
path: '/main',
name: 'main',
//跳转的路径
component: 'Main'//错误写法,不能加引号
}
]
去掉引号后页面正常显示

浙公网安备 33010602011771号