# 发起一个GET请求

export default {
  data(){
    return { }
  },

  onLoad(){
      //案例
    this.$api.get(global.apiUrls.postWorkLike, {
      // 传入参数
    }).then(res => {
      // 接口请求成功做些什么
    }).catch(err => {
      // 接口请求失败做些什么
    })
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16