docs: 新增菜单
parent
bb7d822643
commit
f2d855d25a
|
@ -63,4 +63,4 @@ axios-miniprogram 是一款为小程序平台量身定制的轻量级请求库
|
|||
|
||||
## 未来计划
|
||||
|
||||
2023 年 6 月 1 日 起该库将不再内部支持第三方框架,内置的 uni-app 即将移除,您可以使用适配器兼容 uni-app。
|
||||
2023 年 6 月 1 日 起该库将不再内部支持第三方框架,内置的 uni-app 即将移除,您可以使用[适配器(https://axios-miniprogram.com/advanced/adapter)]兼容 uni-app。
|
||||
|
|
|
@ -38,7 +38,7 @@ export default defineConfig({
|
|||
if (relativePath === 'intro.md') {
|
||||
return 'https://github.com/zjx0905/axios-miniprogram/edit/main/README.md';
|
||||
}
|
||||
return 'https://github.com/zjx0905/axios-miniprogram/edit/main/docs/pages/:path';
|
||||
return `https://github.com/zjx0905/axios-miniprogram/edit/main/docs/pages/${relativePath}`;
|
||||
},
|
||||
text: '在 GitHub 上编辑此页面',
|
||||
},
|
||||
|
@ -115,6 +115,9 @@ function sidebar() {
|
|||
{ text: '默认配置', link: '/basics/defaults' },
|
||||
{ text: '响应体', link: '/basics/response' },
|
||||
{ text: '发送请求', link: '/basics/request' },
|
||||
{ text: '动态地址', link: '/basics/dynamic-url' },
|
||||
{ text: '参数系列化', link: '/basics/params-serializer' },
|
||||
{ text: '转换数据', link: '/basics/transform-data' },
|
||||
{ text: '上传文件', link: '/basics/upload' },
|
||||
{ text: '下载文件', link: '/basics/download' },
|
||||
{ text: '错误处理', link: '/basics/error-handler' },
|
||||
|
@ -129,7 +132,7 @@ function sidebar() {
|
|||
{ text: '响应拦截器', link: '/advanced/response-interceptor' },
|
||||
{ text: '创建实例', link: '/advanced/instance' },
|
||||
{ text: '派生领域', link: '/advanced/fork' },
|
||||
{ text: '适配器', link: '/advanced/adapter' },
|
||||
{ text: '平台适配器', link: '/advanced/adapter' },
|
||||
],
|
||||
collapsed: false,
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
title: 适配器
|
||||
title: 平台适配器
|
||||
---
|
||||
|
||||
# {{ $frontmatter.title }}
|
||||
|
@ -239,7 +239,9 @@ axios.defaults.adapter = (config) => {
|
|||
|
||||
## 使用 `createAdapter` 创建适配器
|
||||
|
||||
可以使用 `createAdapter` 简化适配流程,直接使用可以完美适配小程序平台,但不能保证完美适配小程序以外的其他平台,如 h5,APP。
|
||||
可以使用 `createAdapter` 简化适配流程。
|
||||
|
||||
直接使用可以完美适配小程序平台,但不能保证完美适配小程序以外的其他平台,如 App、H5。
|
||||
|
||||
```ts
|
||||
import axios from 'axios-miniprogram';
|
||||
|
|
|
@ -87,7 +87,7 @@ domain.defaults.timeout = 1000;
|
|||
|
||||
基于 `instance` 派生出的 `domain`,在发送请求时会使用 `instance` 的拦截器。
|
||||
|
||||
无法为 `domain` 单独添加拦截器。
|
||||
目前上不支持为 `domain` 单独添加拦截器。
|
||||
|
||||
## 使用
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
title: 动态地址
|
||||
---
|
||||
|
||||
# {{ $frontmatter.title }}
|
||||
|
||||
::: tip {{ $frontmatter.title }}
|
||||
简化设置地址参数。
|
||||
:::
|
||||
|
||||
未完待续...
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
title: 参数系列化
|
||||
---
|
||||
|
||||
# {{ $frontmatter.title }}
|
||||
|
||||
::: tip {{ $frontmatter.title }}
|
||||
支持自定义参数系列化器。
|
||||
:::
|
||||
|
||||
未完待续...
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
title: 转换数据
|
||||
---
|
||||
|
||||
# {{ $frontmatter.title }}
|
||||
|
||||
::: tip {{ $frontmatter.title }}
|
||||
支持 请求发出前转换请求数据,响应到达 `then` 之前转换响应数据。
|
||||
:::
|
||||
|
||||
未完待续...
|
Loading…
Reference in New Issue