Skip to content

fix(Dialog): destroyOnClose 为 true 时 onBeforeOpen 事件重复触发的问题 #5449

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

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

l123wx
Copy link

@l123wx l123wx commented May 14, 2025

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

#4835

💡 需求背景和解决方案

📝 更新日志

  • 本条 PR 不需要纳入 Changelog

tdesign-vue-next

  • feat(Dialog): 修复 destroyOnClose 为 true 时 onBeforeOpen 事件重复触发的问题

@tdesign-vue-next/chat

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@l123wx
Copy link
Author

l123wx commented May 14, 2025

destroyOnClose 的本意是在 dialog 关闭时销毁 dialog 的子元素,所以把原来整个 dialog 都销毁的逻辑改成了只销毁 子元素。isDialogClosed 用于避免 visible = false 时子元素马上被销毁出现闪烁的情况

@tdesign-bot
Copy link
Collaborator

tdesign-bot commented May 14, 2025

TDesign Component Site Preview Open

Component Preview
tdesign-vue-next 完成
@tdesign-vue-next/chat 完成

Copy link

pkg-pr-new bot commented May 14, 2025

tdesign-vue-next-demo

npm i https://pkg.pr.new/tdesign-vue-next@5449

commit: 8167133

@uyarn uyarn self-requested a review May 29, 2025 09:01
@uyarn
Copy link
Collaborator

uyarn commented May 29, 2025

重新验证了下 https://stackblitz.com/edit/arxhzckq-adqpd4nd?file=src%2FDemo.vue 二次打开会还是会有多次触发的情况

@l123wx
Copy link
Author

l123wx commented May 29, 2025

重新验证了下 stackblitz.com/edit/arxhzckq-adqpd4nd?file=src%2FDemo.vue 二次打开会还是会有多次触发的情况

看了一下是 dev 合进来的代码改了部分逻辑,我改一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants