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

demo: Form + Modal 优化 #47677

Closed
wants to merge 12 commits into from
Closed

demo: Form + Modal 优化 #47677

wants to merge 12 commits into from

Conversation

crazyair
Copy link
Member

@crazyair crazyair commented Mar 1, 2024

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English
🇨🇳 Chinese

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Copy link

stackblitz bot commented Mar 1, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Contributor

github-actions bot commented Mar 1, 2024

Preview is ready

Copy link
Contributor

github-actions bot commented Mar 1, 2024

👁 Visual Regression Report for PR #47677 Failed ❌

🎯 Target branch: master (7e6678a)
📖 View Full Report ↗︎

Image name Expected Actual Diff
input-presuffix.compact.png master: 7e6678aa5146311855f3f4fc320a652768a20dae current: pr-47677 diff
input-presuffix.compact.css-var.png master: 7e6678aa5146311855f3f4fc320a652768a20dae current: pr-47677 diff
input-presuffix.dark.png master: 7e6678aa5146311855f3f4fc320a652768a20dae current: pr-47677 diff
input-presuffix.dark.css-var.png master: 7e6678aa5146311855f3f4fc320a652768a20dae current: pr-47677 diff
input-presuffix.default.png master: 7e6678aa5146311855f3f4fc320a652768a20dae current: pr-47677 diff
input-presuffix.default.css-var.png master: 7e6678aa5146311855f3f4fc320a652768a20dae current: pr-47677 diff
upload-avatar.compact.png master: 7e6678aa5146311855f3f4fc320a652768a20dae current: pr-47677 diff
upload-avatar.compact.css-var.png master: 7e6678aa5146311855f3f4fc320a652768a20dae current: pr-47677 diff
upload-avatar.dark.png master: 7e6678aa5146311855f3f4fc320a652768a20dae current: pr-47677 diff
upload-avatar.dark.css-var.png master: 7e6678aa5146311855f3f4fc320a652768a20dae current: pr-47677 diff

Check Full Report for details

Copy link
Contributor

github-actions bot commented Mar 1, 2024

  • 🚨 Please fill changelog in the PR

    • Write with a developer-oriented perspective and narrative method, without describing the details of the repair
    • Describing the problem and the impact on the developer
    • describing the user-first site problem, not your solution
    • Refer: https://ant.design/changelog#501
  • 🚨 请填写 PR 中的 changelog

    • 请用面向开发者的角度叙述方式撰写,不描述修复细节
    • 描述问题和对开发者的影响
    • 描述用户第一现场的问题,而非你的解决方式
    • 参考:https://ant.design/changelog-cn#501

@crazyair crazyair changed the title demo: Form + Modal demo demo: Form + Modal 优化 Mar 1, 2024
Copy link
Contributor

github-actions bot commented Mar 1, 2024

size-limit report 📦

Path Size
./dist/antd.min.js 336.46 KB
./dist/antd-with-locales.min.js 383.35 KB

@crazyair
Copy link
Member Author

crazyair commented Mar 1, 2024

@afc163 @zombieJ

使用 ModalCloseDestroyChildren 组件,达到 Modal 打开加载组件,Modal 关闭卸载组件,Form 就可以写到 Modal 组件里

ModalCloseDestroyChildren 就可以抽离出来当做 HOC 组件可复用

Copy link

codesandbox-ci bot commented Mar 1, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

})}
</div>
);
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个封装还是比较高阶,导致这个例子的复杂度会上升,用户如果有一些自定义需求会不太改的动。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

复杂的这个组建是可复用的,我觉得还好。主要是 Modal 能支持打开加载,关闭卸载,用户使用时会变的简单很多

>
{node}
</Form>
)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用 modalRender 倒是个不错的思路。

@afc163 afc163 mentioned this pull request Mar 3, 2024
20 tasks
@crazyair crazyair closed this May 17, 2024
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.

None yet

2 participants