diff --git a/.changeset/afraid-falcons-decide.md b/.changeset/afraid-falcons-decide.md new file mode 100644 index 000000000..b7dc892e5 --- /dev/null +++ b/.changeset/afraid-falcons-decide.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +Modal fix: 补充 api 调用中的参数类型声明 diff --git a/.changeset/heavy-panthers-care.md b/.changeset/heavy-panthers-care.md new file mode 100644 index 000000000..d5ab9bb72 --- /dev/null +++ b/.changeset/heavy-panthers-care.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/modal": patch +--- + +fix: 补充 api 调用中的参数类型声明 diff --git a/packages/ui/modal/hi-docs.config.mdx b/packages/ui/modal/hi-docs.config.mdx index bc7e7e28b..ae8776847 100644 --- a/packages/ui/modal/hi-docs.config.mdx +++ b/packages/ui/modal/hi-docs.config.mdx @@ -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 | diff --git a/packages/ui/modal/src/with-api.tsx b/packages/ui/modal/src/with-api.tsx index 1a1ab7326..1cea28e6f 100644 --- a/packages/ui/modal/src/with-api.tsx +++ b/packages/ui/modal/src/with-api.tsx @@ -61,6 +61,9 @@ export interface ModalApiProps | 'type' | 'closeable' | 'showMask' + | 'showHeaderDivider' + | 'closeOnEsc' + | 'maskClosable' > { /** * confirm 的内容 diff --git a/packages/ui/modal/stories/with-api.stories.tsx b/packages/ui/modal/stories/with-api.stories.tsx index 6f8bb82d5..d3e6402e1 100644 --- a/packages/ui/modal/stories/with-api.stories.tsx +++ b/packages/ui/modal/stories/with-api.stories.tsx @@ -34,6 +34,8 @@ export const WithAPI = () => { content: '执行该操作后将无法撤销,是否确定继续?', cancelText: null, confirmText: '确定', + closeOnEsc: false, + maskClosable: false, }) } >