📝 supplement and improve api documentation (#942)

This commit is contained in:
gongshun 2020-09-21 18:13:24 +08:00 committed by GitHub
parent ed4f6d0900
commit 969761a11b
3 changed files with 15 additions and 12 deletions

View File

@ -25,8 +25,9 @@ By linking the micro-application to some url rules, the function of automaticall
- name - `string` - required, the name of the child application and must be unique between the child applications.
- entry - `string | { scripts?: string[]; styles?: string[]; html?: string }` - required, The entry url of the child application.
- entry - `string | { scripts?: string[]; styles?: string[]; html?: string }` - required, The entry of the micro application.
- If configured as `string`, it represents the access address of the micro application. If the micro application is deployed in a secondary directory, the last `/` cannot be omitted. For example, the access address of the micro application is: `https://qiankun.umijs.org/guide`, then the `entry` should be `https://qiankun.umijs.org/guide/`.
- If configured as `object`, the value of `html` is the html content string of the micro application, not the access address of the micro application. The `publicPath` of the micro application will be set to `/`.
- container - `string | HTMLElement` - requiredA selector or Element instance of the container node of a micro application. Such as `container: '#root'` or `container: document.querySelector('#root')`.
- activeRule - - `string | (location: Location) => boolean | Array<string | (location: Location) => boolean> ` - required,activation rules for micro-apps.
@ -158,7 +159,7 @@ By linking the micro-application to some url rules, the function of automaticall
- fetch - `Function` - optional
- getPublicPath - `(url: string) => string` - optional
- getPublicPath - `(enrty: Entry) => string` - optionalThe parameter is the entry value of the micro application.
- getTemplate - `(tpl: string) => string` - optional
@ -227,7 +228,7 @@ A criterion for judging whether the business is closely related: <strong>Look at
* Parameters
* app - `LoadableApp` - Required, basic information of micro application
* name - `string` - Required, the name of the micro application must be unique among the micro applications.
* entry - `string | { scripts?: string[]; styles?: string[]; html?: string }` - Required, the entry address of the micro application.
* entry - `string | { scripts?: string[]; styles?: string[]; html?: string }` - Required, The entry of the micro application(The detailed description is the same as above).
* container - `string | HTMLElement` - Required, selector or Element instance of the container node of the micro application. Such as `container: '#root'` or `container: document.querySelector('#root')`.
* props - `object` - Optional, the data that needs to be passed to the micro-application during initialization.
@ -241,7 +242,7 @@ A criterion for judging whether the business is closely related: <strong>Look at
* fetch - `Function` - Optional, custom fetch method.
* getPublicPath - `(url: string) => string` - Optional
* getPublicPath - `(url: string) => string` - OptionalThe parameter is the entry value of the micro application.
* getTemplate - `(tpl: string) => string` - Optional

View File

@ -25,8 +25,9 @@ toc: menu
- name - `string` - 必选,微应用的名称,微应用之间必须确保唯一。
- entry - `string | { scripts?: string[]; styles?: string[]; html?: string }` - 必选,微应用的 entry 地址。
- entry - `string | { scripts?: string[]; styles?: string[]; html?: string }` - 必选,微应用的入口。
- 配置为字符串时,表示微应用的访问地址。如果微应用部署在二级目录,则最后面的 `/` 不可省略。例如,微应用的访问地址是:`https://qiankun.umijs.org/guide`,那么 `entry` 应该是 `https://qiankun.umijs.org/guide/`
- 配置为对象时,`html` 的值是微应用的 html 内容字符串,而不是微应用的访问地址。微应用的 `publicPath` 将会被设置为 `/`
- container - `string | HTMLElement` - 必选,微应用的容器节点的选择器或者 Element 实例。如`container: '#root'` 或 `container: document.querySelector('#root')`
- activeRule - `string | (location: Location) => boolean | Array<string | (location: Location) => boolean> ` - 必选,微应用的激活规则。
@ -158,11 +159,11 @@ toc: menu
- fetch - `Function` - 可选,自定义的 fetch 方法。
- getPublicPath - `(url: string) => string` - 可选
- getPublicPath - `(enrty: Entry) => string` - 可选,参数是微应用的 entry 值。
- getTemplate - `(tpl: string) => string` - 可选
- excludeAssetFilter - `(assetUrl: string) => boolean` - 可选指定部分特殊的动态加载的微应用资源css/js) 不被qiankun 劫持处理
- excludeAssetFilter - `(assetUrl: string) => boolean` - 可选指定部分特殊的动态加载的微应用资源css/js) 不被 qiankun 劫持处理
- 用法
@ -227,7 +228,7 @@ toc: menu
* 参数
* app - `LoadableApp` - 必选,微应用的基础信息
* name - `string` - 必选,微应用的名称,微应用之间必须确保唯一。
* entry - `string | { scripts?: string[]; styles?: string[]; html?: string }` - 必选,微应用的 entry 地址
* entry - `string | { scripts?: string[]; styles?: string[]; html?: string }` - 必选,微应用的入口(详细说明同上)
* container - `string | HTMLElement` - 必选,微应用的容器节点的选择器或者 Element 实例。如`container: '#root'` 或 `container: document.querySelector('#root')`
* props - `object` - 可选,初始化时需要传递给微应用的数据。
@ -263,7 +264,7 @@ toc: menu
* fetch - `Function` - 可选,自定义的 fetch 方法。
* getPublicPath - `(url: string) => string` - 可选
* getPublicPath - `(entry: Entry) => string` - 可选,参数是微应用的 entry 值。
* getTemplate - `(tpl: string) => string` - 可选

View File

@ -42,7 +42,7 @@
"docs:dev": "dumi dev",
"docs:build": "dumi build",
"ci": "yarn lint && yarn test",
"test": "NODE_ENV=test jest"
"test": "cross-env NODE_ENV=test jest"
},
"repository": {
"type": "git",
@ -73,6 +73,7 @@
"@umijs/fabric": "^2.0.7",
"babel-plugin-import": "^1.12.1",
"check-prettier": "^1.0.3",
"cross-env": "^7.0.2",
"dumi": "^1.0.24",
"father-build": "^1.7.0",
"husky": "^2.3.0",