vue中的函数实现顺序执行
主要是添加async和await
如下:
methods:{
get_users_info:function (){
this.$nextTick(function (){axios({method:'post',url:base_url})
.then((res)=>{this.user_infos=res.data;console.log(this.user_infos)})
.catch(function (error){console.log('上传失败!')})})
},
pr:function (){
console.log("hello")
},
async delete_user(){
await axios({method: 'post',url:this.delete_user_url+this.delete_user_info})
.then((res)=>{console.log("删除成功!")})
.catch(function (error){console.log("删除失败!")});
await this.get_users_info();
},