赞
踩
在router.js文件里配置路由时,不能写空{},在程序里写了空{}是不会报错的,但在程序运行时扫描{}中没有path时会报错
删除{}或者在{}里补全配置至少又要path,和component
- routes: [
- {
- path: '/',
- name: 'home',
- component: Home,
- redirect: '/index',
- children: [
- {
- path: '/index',
- name: 'index',
- component: Index,
- }
- ]
- }
- ]
- });

- routes: [
- {
- path: '/',
- name: 'home',
- component: Home,
- redirect: '/index',
- children: [
- {
- path: '/index',
- name: 'index',
- component: Index,
- }
- ]
- },
- { 报错 }
- ]
- });

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。