在进入某个页面时当我们需要加载某个后端接口的时候可以
getMethod(){
this.$api.get('/xxxx/xxx', {}, r => {
if (r.resultCode== '000') {
XXX
}
然后用
activated(){
this.getMethod()
},
deactivated(){
this.getMethod()
}
就可以在进入某个index页面加载’/xxxx/xxx’该url地址的后台接口了。