Arrays in vue cannot use array methods such as foreach

reason

The monitor set by the vue framework on the data causes Observer and observer mode to appear behind the array. It is not enumerable and xx[0] cannot be taken from it.

solution

Regenerate an enumerable array through a deep copy
JSON.parse(JSON.stringify(store.getters.menuList))

Guess you like

Origin blog.csdn.net/weixin_42215897/article/details/121120732