-
Notifications
You must be signed in to change notification settings - Fork 0
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
4 changed files
with
5,269 additions
and
6,316 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 |
---|---|---|
@@ -1 +1,55 @@ | ||
# 快速上手 | ||
|
||
## 安装 | ||
|
||
```bash | ||
npm install @mx-space/api-client --save | ||
``` | ||
|
||
## 开发自定义弹窗组件 | ||
|
||
```tsx pure | ||
export type MyModalProps = { | ||
visible: boolean; | ||
onOk: () => void; | ||
onCancel: () => void; | ||
afterClose: () => void; | ||
}; | ||
|
||
export default function MyModal({ | ||
visible, | ||
onOk, | ||
onCancel, | ||
afterClose, | ||
}: MyModalProps) { | ||
// your code here | ||
return <Modal {/*** your props **/}> | ||
{/*** your content here **/}</Modal>; | ||
} | ||
``` | ||
|
||
## 使用 openify | ||
|
||
```tsx pure | ||
import { openify } from 'openify'; | ||
|
||
openify(CustomModal); | ||
``` | ||
|
||
## 使用 open 方法 | ||
|
||
```tsx pure | ||
export default function MyApp() { | ||
return ( | ||
<Button | ||
onClick={() => { | ||
CustomModal.open({ | ||
// your props | ||
}); | ||
}} | ||
> | ||
打开弹窗 | ||
</Button> | ||
); | ||
} | ||
``` |
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
Oops, something went wrong.