不明白push()在这里为啥不能用, 请各位大佬不吝赐教(感谢感谢)
示例代码
let fileList : UTSJSONObject[] = [];
let data = {
"file": '123.jpg'
}
data['name'] = [] as UTSJSONObject[]
data['name'].push({ val: '2' })
fileList.push(data)
console.log('fileList=>', fileList)
报错信息
[plugin:uni:app-uts] 编译失败
18:00:54.791 error: Unresolved reference: push
18:00:54.791 at pages/album/index.uvue:41:16
18:00:54.791 39 |
18:00:54.791 40 | data['name'] = [] as UTSJSONObject[]
18:00:54.791 41 | data['name'].push({ val: '2' })
18:00:54.791 | ^
18:00:54.791 42 |
18:00:54.791 43 | fileList.push(data)
不应识 (作者)
谢谢大佬
2024-03-26 10:24