generated from arvinxx/npm-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
title: useEasyAntdModal | ||
description: 上下文 Hook | ||
order: 2 | ||
group: Hooks | ||
--- | ||
|
||
## 简介 | ||
|
||
该 Hook 用于获取 EasyAntdModal 的上下文, 通过该 Hook 可以获取到 Modal 的配置 | ||
|
||
```tsx | ||
import { useEasyAntdModal } from 'easy-antd-modal'; | ||
|
||
export default () => { | ||
const { triggerProps, contentProps } = useEasyAntdModal(); | ||
return ( | ||
<> | ||
<p>triggerProps: {JSON.stringify(triggerProps)}</p> | ||
<p>contentProps: {JSON.stringify(contentProps)}</p> | ||
</> | ||
); | ||
}; | ||
``` | ||
|
||
## API | ||
|
||
| 参数 | 说明 | 类型 | 默认值 | | ||
| ------------ | -------------------- | --------------------- | ---------- | | ||
| triggerProps | Modal 触发器的 props | `trigger \| children` | `trigger` | | ||
| contentProps | Modal 内容的 props | `children \| content` | `children` | |