Vue项目报错object null is not iterable (cannot read property Symbol(Symbol.iterator))
开发时遇到iterableToArray.js?db90:2 Uncaught (in promise) TypeError: object null is not iterable (cannot read property Symbol(Symbol.iterator))遇到这样的错应该是解构赋值时存在错误常见的解构错误有://1. errorconst arr = { name: 'hell
·
开发时遇到iterableToArray.js?db90:2 Uncaught (in promise) TypeError: object null is not iterable (cannot read property Symbol(Symbol.iterator))
遇到这样的错应该是解构赋值时存在错误
常见的解构错误有:
//1. error
const arr = { name: 'hellow' }
const [var1, var2] = arr // 解构错误
//2.error
const a = null
const [var1] = a // 解构错误,标题错误
//3.error
const b = [12 ,34]
const { a , b } = {...b} // 也会报错
解决方法:确保结构时类型一致
更多推荐
已为社区贡献1条内容
所有评论(0)