Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dialog): Dialog component support confirmLoading #2814

Merged
merged 2 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dialog/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default Vue.extend({
const defaultButtonProps = this.getDefaultConfirmBtnProps(options);
// 属性和插槽都不存在,就返回全局默认配置
if (!confirmBtn && !this.$scopedSlots.confirmBtn) {
return <TButton class={className} props={{ ...defaultButtonProps }} />;
return <TButton class={className} props={{ loading: confirmLoading, ...defaultButtonProps }} />;
}
// 如果属性存在,优先返回属性配置
if (confirmBtn && ['string', 'object'].includes(typeof confirmBtn)) {
Expand Down
6 changes: 0 additions & 6 deletions src/dialog/dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@
{{ plugin }}

## API
### DialogCard Props

名称 | 类型 | 默认值 | 说明 | 必传
-- | -- | -- | -- | --
`Pick<DialogProps, 'body' \| 'cancelBtn' \| 'closeBtn' \| 'confirmBtn' \| 'footer' \| 'header' \| 'theme' \| 'onCancel' \| 'onCloseBtnClick' \| 'onConfirm'>` | String / Slot / Function | - | 继承 `Pick<DialogProps, 'body' \| 'cancelBtn' \| 'closeBtn' \| 'confirmBtn' \| 'footer' \| 'header' \| 'theme' \| 'onCancel' \| 'onCloseBtnClick' \| 'onConfirm'>` 中的全部属性。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N

### Dialog Props

名称 | 类型 | 默认值 | 说明 | 必传
Expand Down
Loading