-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
31 changed files
with
298 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ module.exports = { | |
], | ||
], | ||
}, | ||
prod: { | ||
production: { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = { | ||
// https://www.npmjs.com/package/@commitlint/config-conventional | ||
extends: ['@commitlint/config-conventional'], | ||
"rules": { | ||
rules: { | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
# 配置说明 | ||
在 `tua-api` 中配置分为三种: | ||
在 `tua-api` 中配置分为四种: | ||
|
||
* 默认配置(调用 `new TuaApi({ ... })` 时传递的) | ||
* 公共配置(和 `pathList` 同级的配置) | ||
* 自身配置(`pathList` 数组中的对象上的配置) | ||
* [默认配置(调用 `new TuaApi({ ... })` 时传递的)](./default.md) | ||
* [公共配置(和 `pathList` 同级的配置)](./common.md) | ||
* [自身配置(`pathList` 数组中的对象上的配置)](./self.md) | ||
* [运行配置(在实际调用接口时传递的配置)](./runtime.md) | ||
|
||
其中优先级自然是: | ||
|
||
`默认配置 < 公共配置 < 自身配置` | ||
`默认配置 < 公共配置 < 自身配置 < 运行配置` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# 运行配置 | ||
运行配置指的是在接口实际调用时通过第二个参数传递的配置。这部分的配置优先级最高。 | ||
|
||
以下接口以导出为 `exampleApi` 为例。 | ||
|
||
```js | ||
exampleApi.foo( | ||
{ ... }, // 第一个参数传接口参数 | ||
{ ... } // 第二个参数传接口配置 | ||
) | ||
``` | ||
|
||
## callbackName 回调函数名称 | ||
在通过 jsonp 发起请求时,为了使用缓存一般需要添加 callbackName,但是注意重复请求时会报错。 | ||
|
||
```js | ||
exampleApi.foo( | ||
{ ... }, | ||
{ callbackName: `foo` } | ||
) | ||
``` | ||
|
||
## 其他参数 | ||
公共配置一节中的所有参数(除了 `pathList` 外),以及自身配置一节中的所有参数均有效,且优先级最高。 | ||
|
||
* 详情参阅[公共配置](./common.md) | ||
* 详情参阅[自身配置](./self.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.