代码之家  ›  专栏  ›  技术社区  ›  Andres Felipe

更新对象并持久化

  •  0
  • Andres Felipe  · 技术社区  · 8 年前

    enter image description here

    我想更新对象上的每个学生,每个学生都有一个唯一的索引(来自数据库的id),这样我可以稍后将该对象发送到服务器,我就是这样尝试的:

    studentID=param(整数)
    注释=参数(对象)

    for (let i = 0; i < this.studentNotes[studentID].desempenos.length; i++) {
        if (this.studentNotes[studentID].desempenos[i].desempeno === desempeno) {
            this.studentNotes[studentID].desempenos[i].nota = notes.nota;
        }
    }
    

    问题在于:

    我不明白为什么。

    提前谢谢。

    0 回复  |  直到 8 年前