-
-
Notifications
You must be signed in to change notification settings - Fork 323
fix: 修复children为函数时,wd-tabs渲染错误 #1211
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
base: master
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
✅ Deploy Preview for wot-design-uni ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Walkthrough本次变更主要对 Changes
Sequence Diagram(s)sequenceDiagram
participant ParentComponent
participant useChildren
participant flattenVNodes
participant sortChildren
ParentComponent->>useChildren: 调用 sortChildren(parent)
useChildren->>sortChildren: 传递 parent.subTree
sortChildren->>flattenVNodes: 递归扁平化 VNode 结构
flattenVNodes-->>sortChildren: 返回扁平 VNode 列表
sortChildren->>useChildren: 通过唯一 ID 排序 publicChildren
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Possibly related issues
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
🔇 Additional comments (6)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/uni_modules/wot-design-uni/components/composables/useChildren.ts(2 hunks)tests/components/wd-tabs.test.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: Moonofweisheng
PR: Moonofweisheng/wot-design-uni#733
File: src/uni_modules/wot-design-uni/components/wd-tabs/wd-tabs.vue:327-327
Timestamp: 2024-11-24T06:12:44.418Z
Learning: 在 `src/uni_modules/wot-design-uni/components/wd-tabs/wd-tabs.vue` 中,由于 `title` 可能会发生变化,涉及到 `title` 的优化不太容易实现,需谨慎处理。
📚 Learning: 在 `src/uni_modules/wot-design-uni/components/wd-tabs/wd-tabs.vue` 中,由于 `title` 可能会发生变化,涉及到 `title` 的...
Learnt from: Moonofweisheng
PR: Moonofweisheng/wot-design-uni#733
File: src/uni_modules/wot-design-uni/components/wd-tabs/wd-tabs.vue:327-327
Timestamp: 2024-11-24T06:12:44.418Z
Learning: 在 `src/uni_modules/wot-design-uni/components/wd-tabs/wd-tabs.vue` 中,由于 `title` 可能会发生变化,涉及到 `title` 的优化不太容易实现,需谨慎处理。
Applied to files:
tests/components/wd-tabs.test.ts
📚 Learning: 在文件 `wd-message-box.vue` 的 `togglemodal` 方法中,当 `ispass` 为 `false` 时,应阻止执行 `confirm`,但不触发 `cancel` 操作...
Learnt from: Moonofweisheng
PR: Moonofweisheng/wot-design-uni#761
File: src/uni_modules/wot-design-uni/components/wd-message-box/wd-message-box.vue:166-182
Timestamp: 2024-12-05T15:55:35.371Z
Learning: 在文件 `wd-message-box.vue` 的 `toggleModal` 方法中,当 `isPass` 为 `false` 时,应阻止执行 `confirm`,但不触发 `cancel` 操作。
Applied to files:
tests/components/wd-tabs.test.ts
📚 Learning: 在 `src/uni_modules/wot-design-uni/components/wd-progress/wd-progress.vue` 文件中,当 `percentage` 为 0 时,应...
Learnt from: Moonofweisheng
PR: Moonofweisheng/wot-design-uni#748
File: src/uni_modules/wot-design-uni/components/wd-progress/wd-progress.vue:87-128
Timestamp: 2024-11-30T06:44:18.181Z
Learning: 在 `src/uni_modules/wot-design-uni/components/wd-progress/wd-progress.vue` 文件中,当 `percentage` 为 0 时,应通过 `update` 函数处理 `percentage` 为 0 的情况,而不需要在 `updateProgress` 函数中进行特殊处理。
Applied to files:
tests/components/wd-tabs.test.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Generate Test Summary
🔇 Additional comments (2)
src/uni_modules/wot-design-uni/components/composables/useChildren.ts (1)
66-75: 排序逻辑改进合理使用组件的唯一标识符
uid进行排序比直接使用引用更加可靠,特别是在处理动态组件和函数式子组件时。这个改进能有效解决原有的排序问题。tests/components/wd-tabs.test.ts (1)
431-467: 测试用例实现合理新增的测试用例很好地验证了当 tab 数据动态变化时,导航项的顺序是否正确。测试覆盖了从单个 tab 到多个 tab 的动态更新场景,并正确验证了每个导航项的文本内容和顺序。
🤔 这个 PR 的性质是?(至少选择一个)
🔗 相关 Issue
#1191
💡 需求背景和解决方案
1、修复children为函数时,wd-tabs渲染错误
2、publicChildren.sort排序由 引用 改为 uid
☑️ 请求合并前的自查清单
Summary by CodeRabbit
新功能
修复