getFamily(id) { this.loading = true; listFamily({ studentId: id, pageNum: 1, pageSize: 99 }).then(response => { this.tableData = response.rows; this.loading = false; }); }, /** 查询招生信息列表 */ getList() { this.loading = true; listInformation(this.queryParams).then(response => { this.informationList = response.rows; this.total = response.total; this.loading = false; }); }, 怎么把this.tableData中的realName的值给this.informationList下的guardian
时间: 2024-03-17 14:43:42 浏览: 20
可以使用循环遍历的方式,将 `this.tableData` 中的 `realName` 值赋给 `this.informationList` 下的 `guardian` 属性。具体实现代码如下:
```
for(let i = 0; i < this.tableData.length; i++) {
this.informationList[i].guardian = this.tableData[i].realName;
}
```
其中,`for` 循环遍历 `this.tableData` 中的每个对象,然后将对应的 `realName` 值赋给 `this.informationList` 中相同位置的对象的 `guardian` 属性。
相关问题
nested exception is org.apache.ibatis.binding.BindingException: Parameter 'studentId' not found. Available parameters are [id, param1]
这个错误是由 MyBatis 框架抛出的。它表明在查询语句或映射文件中,找不到名为 'studentId' 的参数。可用的参数是 'id' 和 'param1'。请检查你的代码,确保正确地传递了参数,并且与查询语句或映射文件中的参数名保持一致。如果参数名正确无误,那么可能是你的查询语句或映射文件中未正确引用该参数。
java.sql.SQLException: Field 'studentId' doesn't have a default value
java.sql.SQLException: Field 'studentId' doesn't have a default value 是一个Java中的SQL异常。它表示在向数据库插入数据时,指定的表中的字段 'studentId' 没有设置默认值,而且在插入数据时也没有提供该字段的值。
当创建数据库表时,如果某个字段没有设置默认值,那么在插入数据时就必须为该字段提供一个值。如果没有提供该字段的值,就会抛出这个异常。
解决这个问题的方法有两种:
1. 在插入数据时,为 'studentId' 字段提供一个值。
2. 在创建表时,为 'studentId' 字段设置一个默认值。