Skip to content

Latest commit

 

History

History
38 lines (23 loc) · 505 Bytes

README.md

File metadata and controls

38 lines (23 loc) · 505 Bytes

@roshan-labs/http-module

封装 nuxt $fetch 方法,统一配置 baseURL

安装

yarn add @roshan-labs/http-module -D

API

通过 useHttp 组合式函数导出以下 API 使用

create

传入 $fetch 相同配置,创建新 http 实例

useHttp().create(options)
  • options: $fetch 配置参数

request

发起一个 http 请求

useHttp().request(url, options)
  • url: 请求地址
  • options: $fetch 配置参数

License

MIT