getAccount(){
let that = this
axios({
url:'http://localhost:8080/api/GetAllUniAccounts/',
method:'post'
}).then( res => {
that.accountList=res.data // 写法错误
console.log(that.accountList)
})
}
上方是出错的地方,原因在于第7行,如果这样子写的话,该变量会失去响应式特性,正确的写法是
getAccount(){
let that = this
axios({
url:'http://localhost:8080/api/GetAllUniAccounts/',
method:'post'
}).then( res => {
that.accountList.push(...res.data)
console.log(that.accountList)
})
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)