1. 背景
demo 环境报错。。。
2. 报错问题
3. 问题原因
vue 报错: “RangeError: Maximum call stack size exceeded”
报错通常是由于无限的递归 导致的。当使用 Vue 路由时,如果设置不当,会导致无限的递归,最终导致栈溢出,即 “RangeError: Maximum call stack size exceeded” 报错。
所以结论是需要检查路由设置中是否存在循环依赖或死循环。
4. 实例
const router = new Router({
routes: [
{
path: '/about',
component: About
},
{
path: '/product',
component: Product
},
{
path: '*'