更新记录

1.1(2020-04-22)

改为es6写法

1.0(2019-07-08)

init


平台兼容性

介绍

使用promise封装request

简单封装request,可搭配async await使用,亦可.then 需要到catch的处理reject就行 import ajax from './ajax.js' 导入,在main.js挂载到vue原型,例如 Vue.prototype.$ajax = ajax

基本使用方法

export default {
    mounted() {
        this.getInfo()
    },
  methods: {
    async getInfo() {
            try {
                const { data } = await this.$ajax.get('www.xxx.com', { loading: true })
                console.log(data)
            } catch(e) {
                console.log(e)
            }
        }
  }
}

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT协议

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问