当使用Vue开发前端遇到的问题及解决办法汇总

当使用vue开发前端时,使用router(路由)时遇到如下错误

TypeError: Cannot read property '$createElement' of undefined

原因是定义理由的时候写错了

routes:[
    {
      path:"/goods/:goodsId",
      name:"GoodsList",
      components:GoodsList
    }
  ]

正确的解决方案为将:components改成component即可

猜你喜欢

转载自blog.csdn.net/SeaLong_/article/details/79131495
今日推荐