【文件属性】:
文件名称:lee-http:封装axios
文件大小:1KB
文件格式:ZIP
更新时间:2021-05-13 08:09:38
JavaScript
lee-http
此插件主要是在 VUE 中使用对 axios 的封装
特性
支持 Promise
支持 async await
安装
npm i lee-http --save
OR
yarn add lee-http
使用方法
支持 get 和 post 请求
在 main.js 中
import Http from 'lee-http';
Vue.prototype.Http = Http;
get
async getDate() {
let d = await this.Http.get(url,{params1:1});
console.log(d);
}
post
async getDate() {
let d = await this.post(url,{params1:1});
console.log(d);
}
【文件预览】:
lee-http-master
----package.json(609B)
----index.js(843B)
----README.md(517B)