配置路由报错
import Vue from 'vue';
import Router from 'vue-router';
// import Home from 'pages/home';
// import Category from 'pages/category';
// import Cart from 'pages/cart';
// import Personal from 'pages/personal';
// import Search from 'pages/search';
import Product from 'pages/product';
Vue.use(Router);
const routes=[
{
name:'home',
path:'/home',
component:()=>import('pages/home'),
children:[
{
name:'home-product',
path:'product/:id',
component:()=>import('pages/product')
}
]
},
{
name:'category',
path:'/category',
component:()=>import('pages/category')
},
{
name:'cart',
path:'/cart',
ccomponent:()=>import('pages/cart')
},
{
name:'personal',
path:'/personal',
component:()=>import('pages/personal')
},
{
name:'search',
path:'/search',
component:()=>import('pages/search')
},
{
name:'*',
redirect:'/home'
}
];
export default new Router({
routes
});
vue-router.esm.js?fe87:10 Uncaught Error: [vue-router] "path" is required in a route configuration.
at assert (vue-router.esm.js?fe87:10)
at addRouteRecord (vue-router.esm.js?fe87:1146)
at eval (vue-router.esm.js?fe87:1116)
at Array.forEach (<anonymous>)
at createRouteMap (vue-router.esm.js?fe87:1115)
at createMatcher (vue-router.esm.js?fe87:1336)
at new VueRouter (vue-router.esm.js?fe87:2430)
at eval (index.js?3672:49)
at Object../src/router/index.js (app.js:3589)
at __webpack_require__ (app.js:708)
正在回答 回答被采纳积分+1
- 参与学习 人
- 提交作业 209 份
- 解答问题 3299 个
本路径是通过ES6基础知识、运用Zepto、Swiper、fullPag等移动端常用工具包、以及当下流行框架Vue,结合多个实战案例,还原真实开发场景,最终实现手机端购物商城网页开发。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星