Skip to content

Commit

Permalink
Docs/test utils (#110)
Browse files Browse the repository at this point in the history
* fix: 修复表格没有换行导致在预览页没有正常绘制

---------

Co-authored-by: zhuminghui2 <[email protected]>
  • Loading branch information
heiazu and heiazu authored Jun 27, 2023
1 parent 3a17fe3 commit 094d914
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 16 deletions.
17 changes: 14 additions & 3 deletions docs/test-utils/life-cycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ function onPageNotFound(): Promise<{ path: string; query: object; isEntryPage: b
```

回调参数:
| 属性 | 类型 | 说明 |

| 属性 | 类型 | 说明 |
| ----------- | ------- | ------------------------------------------------------------------------------ |
| path | string | 不存在页面的路径 |
| query | Object | 打开不存在页面的 query 参数 |
| path | string | 不存在页面的路径 |
| query | Object | 打开不存在页面的 query 参数 |
| isEntryPage | boolean | 是否本次启动的首个页面(例如从分享等入口进来,首个页面是开发者配置的分享页面) |

用法:
Expand All @@ -105,11 +106,21 @@ function onUnhandledRejection(): Promise<{ reason: string; promise: Promise<unkn
```

回调参数:
<<<<<<< HEAD

| 属性 | 类型 | 说明 |
| ------- | ------- | ------------------------------- |
| reason | string | 拒绝原因,一般是一个 Error 对象 |
| promise | Promise | 被拒绝的 Promise 对象 |

=======
| 属性 | 类型 | 说明 |
| ------- | ------- | ------------------------------- |
| reason | string | 拒绝原因,一般是一个 Error 对象 |
| promise | Promise | 被拒绝的 Promise 对象 |

> > > > > > > master

用法:

```ts
Expand Down
13 changes: 7 additions & 6 deletions docs/test-utils/queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ title: 查询相关 API
## 类型说明

TWaitforParams:
| 参数 | 类型 | 必须 | 默认值 | 说明 |
| ----------- | ----------- | -------------- |-------------- |-------------- |
| container | HTMLElement | | | window.document | 查询的 root 节点 |
| timeout | number | | 1000 | 失效时间 |
| interval | number | | 50 | 查询间隔 |
| mutationObserverOptions | MutationObserverInit | | {subtree: true, childList: true, attributes: true, characterData: true }| 监听器参数 |

| 属性 | 类型 | 必须 | 默认值 | 说明 |
| ----------------------- | -------------------- | ---- | ------------------------------------------------------------------------ | --------------- | ---------------- |
| container | HTMLElement | | | window.document | 查询的 root 节点 |
| timeout | number | | 1000 | 失效时间 |
| interval | number | | 50 | 查询间隔 |
| mutationObserverOptions | MutationObserverInit | | {subtree: true, childList: true, attributes: true, characterData: true } | 监听器参数 |

## 按照选择器查询

Expand Down
15 changes: 8 additions & 7 deletions docs/test-utils/render.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ async mount(component, params);
| params | TParams | | 参数 |

params 类型 `TParams`
| 参数 | 类型 | 必须 | 默认值 | 说明 | 备注 |
| ----------- | ----------- | -------------- |-------------- |-------------- |-------------- |
| props | Object | | {} | props 入参 |
| slots | Object | | {} | slots 入参 | vue 特有 |
| container | HTMLElement | | div | 挂载容器节点 |
| baseElement | HTMLElement | | document.body |打印出来的节点 |
| baseElement | HTMLElement | | document.body |打印出来的节点 |

| 参数 | 类型 | 必须 | 默认值 | 说明 | 备注 |
| ----------- | ----------- | ---- | ------------- | -------------- | -------- |
| props | Object | | {} | props 入参 |
| slots | Object | | {} | slots 入参 | vue 特有 |
| container | HTMLElement | | div | 挂载容器节点 |
| baseElement | HTMLElement | | document.body | 打印出来的节点 |
| baseElement | HTMLElement | | document.body | 打印出来的节点 |

用法:

Expand Down

0 comments on commit 094d914

Please sign in to comment.