Skip to content

Commit

Permalink
添加快速上手文档
Browse files Browse the repository at this point in the history
  • Loading branch information
asurance committed May 19, 2024
1 parent fd3a45c commit 20f1fca
Show file tree
Hide file tree
Showing 4 changed files with 5,269 additions and 6,316 deletions.
54 changes: 54 additions & 0 deletions docs/guide/intro/getting-started.mdx
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>
);
}
```
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@arco-design/web-react": "^2.62.0",
"@modern-js/eslint-config": "2.49.3",
"@modern-js/module-tools": "2.49.3",
"@modern-js/plugin-rspress": "1.21.0",
"@types/node": "~16.11.68",
"@types/react": "^17.0.80",
"@types/react-dom": "^17.0.25",
Expand All @@ -47,12 +48,11 @@
"react": "^17.0.2",
"react-dom": "^17.0.2",
"rimraf": "~3.0.2",
"typescript": "~5.0.4",
"@modern-js/plugin-rspress": "1.21.0"
"typescript": "~5.0.4"
},
"sideEffects": [],
"publishConfig": {
"access": "public"
},
"packageManager": "pnpm@9.1.0"
"packageManager": "pnpm@8.15.8"
}
Loading

0 comments on commit 20f1fca

Please sign in to comment.