Skip to content

Commit

Permalink
Merge pull request #2669 from XiaoMi/hotfix/2665(modal)
Browse files Browse the repository at this point in the history
fix(modal): 补充 api 调用中的参数类型声明 (#2665)
  • Loading branch information
solarjoker authored Nov 17, 2023
2 parents 49ddaa2 + d8e7308 commit 427348a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/afraid-falcons-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hi-ui/hiui": patch
---

Modal fix: 补充 api 调用中的参数类型声明
5 changes: 5 additions & 0 deletions .changeset/heavy-panthers-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hi-ui/modal": patch
---

fix: 补充 api 调用中的参数类型声明
5 changes: 4 additions & 1 deletion packages/ui/modal/hi-docs.config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
| onConfirm | 确认事件触发时的回调 | () => void | - | - |
| onCancel | 取消事件触发时的回调 | () => void | - | - |
| title | 确认弹窗的标题 | string | - | string |
| content | 确认弹窗的内容 | string | - | - |
| content | 确认弹窗的内容 | ReactNode | - | - |
| type | confirm 的类型 | string | 'default' \| 'success' \| 'error' \| 'warning' \| 'info' | 'default' |
| cancelText | 取消按钮文案 | string | - | '取消' |
| confirmText | 确认按钮文案 | string | - | '确定' |
| showHeaderDivider | 展示 header 与内容的分割线 | boolean | - | - |
| closeOnEsc | 开启 Esc 快捷键关闭 | boolean | - | true |
| maskClosable | 开启点击蒙层时关闭 | boolean | - | true |
3 changes: 3 additions & 0 deletions packages/ui/modal/src/with-api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ export interface ModalApiProps
| 'type'
| 'closeable'
| 'showMask'
| 'showHeaderDivider'
| 'closeOnEsc'
| 'maskClosable'
> {
/**
* confirm 的内容
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/modal/stories/with-api.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ export const WithAPI = () => {
content: '执行该操作后将无法撤销,是否确定继续?',
cancelText: null,
confirmText: '确定',
closeOnEsc: false,
maskClosable: false,
})
}
>
Expand Down

0 comments on commit 427348a

Please sign in to comment.