|
阅读:4599回复:0
vue报错解决干货
1.问题:vue中爆错Error in render: "TypeError: Cannot read property '0' of undefined"
解决:vue组件中的参数未接收到,和路由的动态添加无关 2.问题:动态添加路由和子路由 解决: 添加子路由 staticroutes[2].children = [...powerroutes] this.$router.addRoutes(this.$router.options.routes) 添加路由 this.$router.options.routes.push(路由对象) 3.问题:动态添加的路由刷新后失效 解决:主要就是利用了beforeEach拦截+sessionStorage的数据存储,就能完成,addRoutes动态添加路由刷新不失效功能。 4.问题:使用axios时报错TypeError: Cannot read property 'protocol' of undefined 解决:不能使用Vue.use(axios)使用axios,或者url是undefined |
|