Advertisement

Vue刷新页面时动态添加路由会导致Maximum call stack size exceed,并报错Cannot read property 'matched' of undefined

阅读量:

在Vue项目环境中,在用户体验发生刷新操作时(或:当用户触发页面刷新事件时),可能导致保存到vuex系统中的菜单数据被清空(或:菜单数据被重置为空),因此必须依赖缓存机制来恢复相应的菜单设置。

但是发现,有时候会报错

"RangeError: Maximum call stack size exceeded"

Maximum call stack size exceeded

Cannot read property 'matched' of undefined"

Cannot read property 'matched' of undefined

这段代码出现栈溢出错误(Maximum call stack size exceeded)。通常是因为递归函数没有设置终止条件(recursive function not having a termination condition)。然而我发现我的递归方法本身并没有问题(already implemented proper judgment logic),但仍然会触发此错误(still trigge

全部评论 (0)

还没有任何评论哟~