let matched = this.$route.matched.filter(item => item.meta && item.meta.title)
matched.map(val => {
// 解决方法
val.instances = {}
})
// levelList = this.jsons(levelList)
this.$store.commit('app/TOGGLE_NEVLIST', this.levelList)
error during render : url=/rank/soft err= TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Vue'
| property '$options' -> object with constructor 'Object'
| property 'router' -> object with constructor 'VueRouter'
--- property 'app' closes the circle
at JSON.stringify (<anonymous>)
- vue的 $router在执行的时候会使用JSON.stringify去处理路由
- node环境中是拒绝循环引用的1.
- this.$route.matched.filter返回的数据中 instances 执行 当前的对象(暂时认为是当前路由对象,欢迎举证)
- 上面(1)中 存在循环引用 报错
- 把instances 指向空对象能避免后面路由的使用报错