Skip to content

roshan-labs/http-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

763b20f · Jan 12, 2023

History

96 Commits
Jan 12, 2023
Jan 6, 2023
Feb 22, 2022
Feb 22, 2022
Oct 12, 2022
Feb 22, 2022
Oct 28, 2022
Jan 12, 2023
Apr 30, 2022
Nov 19, 2022
Jan 6, 2023
Jan 12, 2023
Jan 12, 2023
Jan 12, 2023
Oct 11, 2022

Repository files navigation

@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