1、在table中数据更新视图不更新
for(let i=0;i<re.list.length;i++){
userApi.selectUser(re.list[i].userId).then(data=>{
console.log(data);
_this.tableData[i].name=data.response.realName
//this.tableData[i].name=data.response.realName
this.$set(_this.tableData, i, _this.tableData[i])
}) }
2、监听对象某一属性,实现双向数据绑定
watch: {
//对象双向数据绑定
'form.subjectId'(newVal, oldVal) {
// console.log(`new:${newVal}, old:${oldVal}`);
if(newVal){
this.queryCha.subjectId=newVal;
this.getChapter();
}
},
},