Cannot read property matched of undefined

将router-view节点添加到template之后
console中就报错:

clipboard.png

TypeError: Cannot read property 'matched' of undefined

阅读 16.5k
4 个回答

已解决,写错了property name
应该是new Vue({

router,   //not Router,  需要严格参照router的构造配置http://router.vuejs.org/zh-cn/api/options.html
render: (h)=>h(App) 

}).$mount('#app')

是不是你没在后面添加export default router;这句啊

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题