因为没有reload,vue是动态加载技术,所以只要再度调用数据查询函数,把数据更新之后,页面数据自动改变。
created() {
this.findPersonInfo()
},
methods : {
findPersonInfo(){
axios.get('http://localhost:8002/findAll').then(({data}) => {
this.PersonList = data;
})
},
handleDelete(row){
axios.post('http://localhost:8002/deleteInfo',qs.stringify({
'id' : row.id
})).then(() => {
this.findPersonInfo()
})
}
}
删除人员信息之后再调用加载人员信息的函数 this.findPersonInfo()。