Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
389 views
in Technique[技术] by (71.8m points)

react数组push问题,请问跟版本有关吗?

问题是这样的,今天因为安装某一个模块出了冲突,我就把node_modules删掉重新安装依赖,然后就发生了这个问题
image.png

order_list是一个数组,在处理push操作的时候报了错
image.png

控制台给出的提示是这样的
`OrderTable.jsx:130 Uncaught (in promise) TypeError: Cannot add property 0, object is not extensible

at Array.push (<anonymous>)`

image.png

在重装依赖前是不存在这个问题的,还有这个原本我是用

item.sale_amount = item.value;//

进行赋值,在重装后也报了错,所以我用了一个new_item过渡就没出错

image.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...