1. get请求
let base = ' ' ;
const getRequest = (url,params) =>{
return axios({
url: `${base}${url}`,
method: 'get',
params: params
})
}
2. post请求
const postRequest = (url,params) =>{
return axios({
url: url,
method: 'post',
params: params
})
}
最后
以上就是苗条悟空最近收集整理的关于Vue3 --- axios 简单封装APi1. get请求2. post请求的全部内容,更多相关Vue3内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复