Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/roshan-labs/http-module
🔀 Request module for Nuxt
https://github.com/roshan-labs/http-module
fetch nuxt-module nuxt3
Last synced: about 2 months ago
JSON representation
🔀 Request module for Nuxt
- Host: GitHub
- URL: https://github.com/roshan-labs/http-module
- Owner: roshan-labs
- Created: 2022-02-21T13:59:32.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-12T14:07:05.000Z (about 2 years ago)
- Last Synced: 2023-03-10T14:52:16.258Z (almost 2 years ago)
- Topics: fetch, nuxt-module, nuxt3
- Language: TypeScript
- Homepage:
- Size: 1.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# @roshan-labs/http-module
封装 nuxt `$fetch` 方法,统一配置 `baseURL`
## 安装
```bash
yarn add @roshan-labs/http-module -D
```## API
通过 `useHttp` 组合式函数导出以下 API 使用
### `create`
传入 `$fetch` 相同配置,创建新 `http` 实例
```ts
useHttp().create(options)
```- options: `$fetch` 配置参数
### `request`
发起一个 `http` 请求
```ts
useHttp().request(url, options)
```- url: 请求地址
- options: `$fetch` 配置参数## License
MIT