当使用vue开发前端时,使用router(路由)时遇到如下错误
TypeError: Cannot read property '$createElement' of undefined
原因是定义理由的时候写错了
routes:[
{
path:"/goods/:goodsId",
name:"GoodsList",
components:GoodsList
}
]
正确的解决方案为将:components改成component即可