本文共 361 字,大约阅读时间需要 1 分钟。
接口查出来的数据跟接受的不一致:
例如:用tableData[] 接受json的时候
findAll(){ this.axios.get('http://localhost:8989/personnels').then(res=>{ this.tableData=res.data; }) }
实际上json数据res.data 前还有好几层
改成相应的即可:
findAll(){ this.axios.get('http://localhost:8989/personnels').then(res=>{ this.tableData=res.data._embedded.personnels; }) }
转载地址:http://fksef.baihongyu.com/