Skip to content

Commit

Permalink
docs: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cxt-anys committed Aug 29, 2023
1 parent a410f25 commit 06456fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/hooks/src/useModal/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ const Result:ModalResult = useModal<T,K>((Props:ModalProps<T,K>)=>{},props)
| data | Data passed in when Modal is opened | `T \| Record<string,any> \| undefined` | - |
| props | Props passed in when registering Modal | `K` | `undefined` |

> Note: The difference between 'hide' and 'destroy' is that 'hide' will preserve the state of the Modal, while 'destroy' will terminate the Modal's state.
> For Modals with closing animations, it's advisable to use 'hide' first and then 'destroy' once the animation has completed. **Using 'destroy' directly can result in the animation not completing properly.**
> The difference between data and props is that data is passed in each time Modal is opened, and props is passed in when Modal is registered, and props will not change.
### Result
Expand Down
5 changes: 4 additions & 1 deletion packages/hooks/src/useModal/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ const Result:ModalResult = useModal<T,K>((Props:ModalProps<T,K>)=>{},props)
| data | Modal 打开时传入的 data | `T \| Record<string,any> \| undefined` | - |
| props | 注册 Modal 时传入的 props | `K` | `undefined` |

> data 与 props 的区别在于,data 是每次打开 Modal 时传入的,props 是注册 Modal 时传入的,props 不会变化。
> 注:hide 和 destroy 的区别在于,hide 会保留 Modal 的状态,destroy 会销毁 Modal 的状态。
> 对于有关闭动画的 Modal,可以先使用 hide,等动画结束后再 destroy,**直接使用 destroy 会导致动画无法正常结束。**
> 注: data 与 props 的区别在于,data 是每次打开 Modal 时传入的,props 是注册 Modal 时传入的,props 不会变化。
### Result

Expand Down

0 comments on commit 06456fe

Please sign in to comment.