我的天哪,卡了好久。结果是需要序列化:
序列化的方法:
参考:
https://www.cnblogs.com/fengff/p/8073967.html
什么是序列化,为什么要序列化。
参考:
https://blog.csdn.net/qq_38419433/article/details/79740643
js怎样把对象,装在数组里呢?提交后,怎么变成object了?
有很多条这样的数据格式:
{topicId:16,answer:Array(0),usePrompt:false}
我们后端需要我传数组:
上图的数据有length,所以应该是数组吧?
为什么传给后端。提交的时候,就变成object了?
解决办法是:JSON.stringify(this.ruleForm.allAnswers)
结果:成功!