getServerList(){ axios .get('/server/showList') .then(function(response){ this.servers = response.data // 不刷新 console.log(response.data) }) .catch(function (error) { console.log(error); }); }
打印this: this不是vue对象 修改为: getServerList(){ axios .get('/server/showList') .then(response => { this.servers = response.data console.log(response.data) }) .catch(function (error) { console.log(error); }); }
打印this: