【文件属性】:
文件名称:vue-xhr:axios和jsonp
文件大小:2KB
文件格式:ZIP
更新时间:2021-05-16 18:14:22
JavaScript
“ vue-xhr”是axios和jsonp的适配器
安装
npm install vue-xhr --save
进口
es6
import xhr from "vue-xhr";
d
require("vue-xhr",function(xhr){
})
导入方式
import {get,post,getJSON,getHrefParam} from "vue-xhr";
方法
得到
xhr.get("/user?id=01")
.then((response)=>{
console.log(response)
})
.catch((error)=>{
console.log(error)
})
或者
xhr.get("/user",{
id : 01
})
.then((response)=>{
console.log(response)
})
.ca
【文件预览】:
vue-xhr-master
----README.md(1KB)
----package.json(335B)
----index.js(2KB)