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

[dialog] footer的button可以增加disable功能吗? #2531

Closed
ArthurHsing opened this issue Jun 20, 2023 · 3 comments
Closed

[dialog] footer的button可以增加disable功能吗? #2531

ArthurHsing opened this issue Jun 20, 2023 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@ArthurHsing
Copy link

这个功能解决了什么问题

一个dialog,其中可能有一些网络请求,我得等请求完毕后,footer的'确认'按钮才允许被点击。
现在只有手动更改样式和添加disable逻辑。

你建议的方案是什么

增加footer中button的disable功能。

@github-actions
Copy link
Contributor

👋 @ArthurHsing,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@github-actions
Copy link
Contributor

♥️ 有劳 @zhaodanchun @chaishi @Zack921 @huoyuhao 尽快确认问题。
确认有效后将下一步计划和可能需要的时间回复给 @ArthurHsing

@chaishi
Copy link
Collaborator

chaishi commented Jul 22, 2023

可以。示例代码见官网:https://tdesign.tencent.com/vue/components/dialog。
标题「异步加载类对话框」。

和 Loading 加载状态同理,禁用状态也可以这样写。:confirmBtn="{ disabled: true }"

<t-dialog
  :visible.sync="visible"
  header="保存"
  body="保存中,请稍后"
  :confirmBtn="{
    content: '保存中...',
    theme: 'primary',
    disabled: true,
  }"
  :onConfirm="onConfirm"
  :onClose="close"
/>
<t-dialog
  :visible.sync="visible"
  header="保存"
  body="保存中,请稍后"
  :confirmBtn="{
    content: '保存中...',
    theme: 'primary',
    loading: true,
  }"
  :onConfirm="onConfirm"
  :onClose="close"
/>
image

后续,请认真阅读官网提供的示例代码和文档。

@chaishi chaishi closed this as completed Jul 22, 2023
@chaishi chaishi added the question Further information is requested label Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants