feat: ✨ 新增 root-portal 组件支持从页面中脱离出来,用于解决各种 fixed 失效问题 - #1155
Conversation
✅ Deploy Preview for wot-design-uni ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough本次更新为组件库引入了“根节点传送门(Root Portal)”能力,允许弹窗、通知、选择器等组件通过 Changes
Sequence Diagram(s)sequenceDiagram
participant 用户
participant 业务组件(如Calendar/Popup/Notify等)
participant wd-popup
participant wd-root-portal
participant DOM/平台层
用户->>业务组件: 触发弹窗/通知/选择器等
业务组件->>wd-popup: 传递 rootPortal 属性
alt rootPortal = true
wd-popup->>wd-root-portal: 渲染内容到根节点(teleport/root-portal/renderjs)
wd-root-portal->>DOM/平台层: 内容插入body或uni-app根节点
else rootPortal = false
wd-popup->>DOM/平台层: 按原层级渲染内容
end
Poem
✨ Finishing Touches
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. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Walkthrough新增了一个名为 Changes
|
| beforeDestroy() { | ||
| // 清理,将元素移回原位置 | ||
| if (this.$ownerInstance.$el) { | ||
| (document.querySelector('uni-app') || document.body).removeChild(this.$ownerInstance.$el) |
There was a problem hiding this comment.
Ensure that the element is properly removed from the DOM in all scenarios, including when the component is unmounted or when the app is closed unexpectedly.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #1155 +/- ##
==========================================
- Coverage 85.29% 80.88% -4.41%
==========================================
Files 216 93 -123
Lines 17350 8678 -8672
Branches 2738 1008 -1730
==========================================
- Hits 14798 7019 -7779
+ Misses 2552 1659 -893 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
组件测试摘要 (H5 平台)测试时间: Tue Jul 8 09:42:04 UTC 2025测试结果
|
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (9)
docs/component/calendar.md (1)
441-441: 文档更新规范且一致新增的
root-portal属性文档格式正确,描述清晰准确,与其他属性保持一致的文档风格。建议后续将
$LOWEST_VERSION$占位符替换为实际的版本号。docs/en-US/component/drop-menu.md (1)
209-209: 英文文档更新规范一致新增的
root-portal属性文档描述准确,格式与表格中其他属性保持一致。与中文文档一样,建议后续将
$LOWEST_VERSION$占位符替换为具体版本号。docs/en-US/component/datetime-picker.md (1)
316-316: 文档更新保持高度一致性
root-portal属性文档与其他组件文档格式完全一致,体现了良好的代码库维护标准。建议在发布前统一将所有文档中的
$LOWEST_VERSION$占位符替换为实际支持的最低版本号。docs/component/drop-menu.md (1)
210-210: 文档更新正确,建议更新版本占位符新增的
root-portal属性文档格式正确,描述清晰地说明了该属性用于解决 fixed 定位失效问题。建议将版本号占位符$LOWEST_VERSION$替换为实际的最低支持版本。docs/en-US/component/notify.md (1)
196-196: 英文文档更新正确,建议更新版本占位符新增的
root-portal属性英文文档格式正确,描述清晰准确。建议将版本号占位符$LOWEST_VERSION$替换为实际的最低支持版本。docs/component/select-picker.md (1)
364-364: 文档更新一致且正确,建议更新版本占位符新增的
root-portal属性文档与其他组件保持一致,描述准确说明了该属性用于解决 fixed 定位失效问题。建议将版本号占位符$LOWEST_VERSION$替换为实际的最低支持版本。docs/component/number-keyboard.md (1)
242-242: root-portal 属性文档添加新增的 root-portal 属性文档完整,清楚地说明了其用途是解决 fixed 定位失效问题。建议将
$LOWEST_VERSION$占位符替换为实际的最低版本号。docs/en-US/component/root-portal.md (1)
1-58: Root Portal 组件文档质量良好新增的 Root Portal 组件文档内容全面,清楚地解释了组件用途、平台支持和使用方法。文档结构合理,代码示例实用。
建议进行以下小的改进:
- 将
$LOWEST_VERSION$占位符替换为实际版本号- 考虑在行间添加适当的空行以提高可读性
docs/en-US/component/popup.md (1)
79-79: 改进文档语法建议对英文文档进行以下语法改进:
- "avoid the influence of parent component's transform" → "avoid the influence of the parent component's transform"
- 考虑使用牛津逗号:"transform, filter and other" → "transform, filter, and other"
-When the `root-portal` attribute is set to `true`, the popup will be teleported to the page root node, which can avoid the influence of parent component's transform, filter and other CSS properties on the fixed positioning of the popup. +When the `root-portal` attribute is set to `true`, the popup will be teleported to the page root node, which can avoid the influence of the parent component's transform, filter, and other CSS properties on the fixed positioning of the popup.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (60)
docs/.vitepress/config.mts(1 hunks)docs/.vitepress/locales/en-US.ts(1 hunks)docs/.vitepress/locales/zh-CN.ts(1 hunks)docs/component/calendar.md(1 hunks)docs/component/col-picker.md(1 hunks)docs/component/curtain.md(1 hunks)docs/component/datetime-picker.md(1 hunks)docs/component/drop-menu.md(1 hunks)docs/component/keyboard.md(1 hunks)docs/component/message-box.md(1 hunks)docs/component/notify.md(1 hunks)docs/component/number-keyboard.md(1 hunks)docs/component/picker.md(1 hunks)docs/component/popup.md(2 hunks)docs/component/root-portal.md(1 hunks)docs/component/select-picker.md(1 hunks)docs/en-US/component/curtain.md(1 hunks)docs/en-US/component/datetime-picker.md(1 hunks)docs/en-US/component/drop-menu.md(1 hunks)docs/en-US/component/keyboard.md(1 hunks)docs/en-US/component/message-box.md(1 hunks)docs/en-US/component/notify.md(1 hunks)docs/en-US/component/number-keyboard.md(1 hunks)docs/en-US/component/popup.md(2 hunks)docs/en-US/component/root-portal.md(1 hunks)src/locale/en-US.json(1 hunks)src/locale/zh-CN.json(1 hunks)src/pages.json(1 hunks)src/pages/index/Index.vue(1 hunks)src/subPages/popup/Index.vue(4 hunks)src/subPages/rootPortal/Index.vue(1 hunks)src/uni_modules/wot-design-uni/components/wd-action-sheet/types.ts(1 hunks)src/uni_modules/wot-design-uni/components/wd-action-sheet/wd-action-sheet.vue(1 hunks)src/uni_modules/wot-design-uni/components/wd-calendar/types.ts(1 hunks)src/uni_modules/wot-design-uni/components/wd-calendar/wd-calendar.vue(1 hunks)src/uni_modules/wot-design-uni/components/wd-col-picker/types.ts(1 hunks)src/uni_modules/wot-design-uni/components/wd-col-picker/wd-col-picker.vue(1 hunks)src/uni_modules/wot-design-uni/components/wd-curtain/types.ts(1 hunks)src/uni_modules/wot-design-uni/components/wd-curtain/wd-curtain.vue(1 hunks)src/uni_modules/wot-design-uni/components/wd-datetime-picker/types.ts(1 hunks)src/uni_modules/wot-design-uni/components/wd-datetime-picker/wd-datetime-picker.vue(1 hunks)src/uni_modules/wot-design-uni/components/wd-drop-menu-item/types.ts(1 hunks)src/uni_modules/wot-design-uni/components/wd-drop-menu-item/wd-drop-menu-item.vue(1 hunks)src/uni_modules/wot-design-uni/components/wd-keyboard/types.ts(1 hunks)src/uni_modules/wot-design-uni/components/wd-keyboard/wd-keyboard.vue(1 hunks)src/uni_modules/wot-design-uni/components/wd-message-box/types.ts(2 hunks)src/uni_modules/wot-design-uni/components/wd-message-box/wd-message-box.vue(1 hunks)src/uni_modules/wot-design-uni/components/wd-notify/types.ts(1 hunks)src/uni_modules/wot-design-uni/components/wd-notify/wd-notify.vue(1 hunks)src/uni_modules/wot-design-uni/components/wd-number-keyboard/types.ts(1 hunks)src/uni_modules/wot-design-uni/components/wd-number-keyboard/wd-number-keyboard.vue(1 hunks)src/uni_modules/wot-design-uni/components/wd-picker/types.ts(1 hunks)src/uni_modules/wot-design-uni/components/wd-picker/wd-picker.vue(1 hunks)src/uni_modules/wot-design-uni/components/wd-popup/types.ts(2 hunks)src/uni_modules/wot-design-uni/components/wd-popup/wd-popup.vue(3 hunks)src/uni_modules/wot-design-uni/components/wd-root-portal/wd-root-portal.vue(1 hunks)src/uni_modules/wot-design-uni/components/wd-select-picker/types.ts(1 hunks)src/uni_modules/wot-design-uni/components/wd-select-picker/wd-select-picker.vue(1 hunks)src/uni_modules/wot-design-uni/global.d.ts(1 hunks)tests/components/wd-root-portal.test.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (31)
📓 Common learnings
Learnt from: Moonofweisheng
PR: Moonofweisheng/wot-design-uni#534
File: docs/component/form.md:44-44
Timestamp: 2024-08-19T13:43:36.518Z
Learning: Moonofweisheng prefers addressing syntax errors such as missing quotation marks in the code.
src/uni_modules/wot-design-uni/components/wd-message-box/wd-message-box.vue (2)
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` 的优化不太容易实现,需谨慎处理。
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` 操作。
src/uni_modules/wot-design-uni/components/wd-calendar/wd-calendar.vue (1)
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` 的优化不太容易实现,需谨慎处理。
src/uni_modules/wot-design-uni/components/wd-curtain/wd-curtain.vue (1)
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` 的优化不太容易实现,需谨慎处理。
src/uni_modules/wot-design-uni/components/wd-number-keyboard/wd-number-keyboard.vue (1)
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` 的优化不太容易实现,需谨慎处理。
src/uni_modules/wot-design-uni/components/wd-select-picker/wd-select-picker.vue (1)
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` 的优化不太容易实现,需谨慎处理。
src/uni_modules/wot-design-uni/components/wd-picker/wd-picker.vue (2)
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` 的优化不太容易实现,需谨慎处理。
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` 操作。
docs/.vitepress/locales/zh-CN.ts (1)
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` 的优化不太容易实现,需谨慎处理。
src/uni_modules/wot-design-uni/components/wd-drop-menu-item/wd-drop-menu-item.vue (1)
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` 的优化不太容易实现,需谨慎处理。
docs/component/message-box.md (1)
Learnt from: Moonofweisheng
PR: Moonofweisheng/wot-design-uni#737
File: src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue:25-25
Timestamp: 2024-11-26T02:35:53.123Z
Learning: 在 `wd-divider.vue` 文件(路径:`src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue`)中,`props.customStyle` 是字符串类型,用于传递自定义的样式字符串。
src/uni_modules/wot-design-uni/components/wd-datetime-picker/wd-datetime-picker.vue (2)
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` 的优化不太容易实现,需谨慎处理。
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` 操作。
src/uni_modules/wot-design-uni/components/wd-col-picker/wd-col-picker.vue (2)
Learnt from: Moonofweisheng
PR: Moonofweisheng/wot-design-uni#737
File: src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue:25-25
Timestamp: 2024-11-26T02:35:53.123Z
Learning: 在 `wd-divider.vue` 文件(路径:`src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue`)中,`props.customStyle` 是字符串类型,用于传递自定义的样式字符串。
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` 的优化不太容易实现,需谨慎处理。
src/uni_modules/wot-design-uni/components/wd-keyboard/wd-keyboard.vue (3)
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` 的优化不太容易实现,需谨慎处理。
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` 操作。
Learnt from: Moonofweisheng
PR: Moonofweisheng/wot-design-uni#737
File: src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue:25-25
Timestamp: 2024-11-26T02:35:53.123Z
Learning: 在 `wd-divider.vue` 文件(路径:`src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue`)中,`props.customStyle` 是字符串类型,用于传递自定义的样式字符串。
src/uni_modules/wot-design-uni/components/wd-curtain/types.ts (1)
Learnt from: Moonofweisheng
PR: Moonofweisheng/wot-design-uni#737
File: src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue:25-25
Timestamp: 2024-11-26T02:35:53.123Z
Learning: 在 `wd-divider.vue` 文件(路径:`src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue`)中,`props.customStyle` 是字符串类型,用于传递自定义的样式字符串。
docs/en-US/component/message-box.md (1)
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` 操作。
src/uni_modules/wot-design-uni/global.d.ts (1)
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` 的优化不太容易实现,需谨慎处理。
docs/component/curtain.md (1)
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` 操作。
src/uni_modules/wot-design-uni/components/wd-col-picker/types.ts (1)
Learnt from: Moonofweisheng
PR: Moonofweisheng/wot-design-uni#737
File: src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue:25-25
Timestamp: 2024-11-26T02:35:53.123Z
Learning: 在 `wd-divider.vue` 文件(路径:`src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue`)中,`props.customStyle` 是字符串类型,用于传递自定义的样式字符串。
docs/.vitepress/config.mts (1)
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` 的优化不太容易实现,需谨慎处理。
src/uni_modules/wot-design-uni/components/wd-message-box/types.ts (2)
Learnt from: Moonofweisheng
PR: Moonofweisheng/wot-design-uni#737
File: src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue:25-25
Timestamp: 2024-11-26T02:35:53.123Z
Learning: 在 `wd-divider.vue` 文件(路径:`src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue`)中,`props.customStyle` 是字符串类型,用于传递自定义的样式字符串。
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` 操作。
src/uni_modules/wot-design-uni/components/wd-action-sheet/types.ts (2)
Learnt from: Moonofweisheng
PR: Moonofweisheng/wot-design-uni#737
File: src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue:25-25
Timestamp: 2024-11-26T02:35:53.123Z
Learning: 在 `wd-divider.vue` 文件(路径:`src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue`)中,`props.customStyle` 是字符串类型,用于传递自定义的样式字符串。
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` 的优化不太容易实现,需谨慎处理。
src/uni_modules/wot-design-uni/components/wd-action-sheet/wd-action-sheet.vue (1)
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` 的优化不太容易实现,需谨慎处理。
src/uni_modules/wot-design-uni/components/wd-drop-menu-item/types.ts (1)
Learnt from: Moonofweisheng
PR: Moonofweisheng/wot-design-uni#737
File: src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue:25-25
Timestamp: 2024-11-26T02:35:53.123Z
Learning: 在 `wd-divider.vue` 文件(路径:`src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue`)中,`props.customStyle` 是字符串类型,用于传递自定义的样式字符串。
tests/components/wd-root-portal.test.ts (1)
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` 的优化不太容易实现,需谨慎处理。
src/subPages/rootPortal/Index.vue (2)
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` 操作。
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` 的优化不太容易实现,需谨慎处理。
src/uni_modules/wot-design-uni/components/wd-popup/wd-popup.vue (3)
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` 的优化不太容易实现,需谨慎处理。
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` 操作。
Learnt from: chen-ziwen
PR: Moonofweisheng/wot-design-uni#909
File: src/uni_modules/wot-design-uni/components/wd-input-number/wd-input-number.vue:276-281
Timestamp: 2025-02-20T05:57:28.165Z
Learning: In Vue components, cleanup of one-time timers (setTimeout) during component unmount is optional as they will be automatically cleaned up by the garbage collector. Prefer simpler code unless explicit cleanup is necessary.
src/uni_modules/wot-design-uni/components/wd-popup/types.ts (4)
Learnt from: Moonofweisheng
PR: Moonofweisheng/wot-design-uni#737
File: src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue:25-25
Timestamp: 2024-11-26T02:35:53.123Z
Learning: 在 `wd-divider.vue` 文件(路径:`src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue`)中,`props.customStyle` 是字符串类型,用于传递自定义的样式字符串。
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` 的优化不太容易实现,需谨慎处理。
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` 操作。
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` 函数中进行特殊处理。
docs/component/keyboard.md (1)
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` 操作。
src/subPages/popup/Index.vue (3)
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` 的优化不太容易实现,需谨慎处理。
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` 操作。
Learnt from: Moonofweisheng
PR: Moonofweisheng/wot-design-uni#737
File: src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue:25-25
Timestamp: 2024-11-26T02:35:53.123Z
Learning: 在 `wd-divider.vue` 文件(路径:`src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue`)中,`props.customStyle` 是字符串类型,用于传递自定义的样式字符串。
src/uni_modules/wot-design-uni/components/wd-root-portal/wd-root-portal.vue (1)
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` 的优化不太容易实现,需谨慎处理。
docs/component/popup.md (4)
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` 的优化不太容易实现,需谨慎处理。
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` 操作。
Learnt from: Moonofweisheng
PR: Moonofweisheng/wot-design-uni#1149
File: src/uni_modules/wot-design-uni/components/wd-transition/wd-transition.vue:2-14
Timestamp: 2025-07-06T03:59:35.257Z
Learning: 在 uni-app 框架中,不支持 Vue.js 的动态事件绑定语法,例如 `v-bind="disableTouchMove ? { '@touchmove.stop.prevent': noop } : {}"` 或条件事件绑定。因此在 uni-app 项目中,需要使用多个独立的元素来处理条件性的事件绑定,即使这会导致一些代码重复。
Learnt from: Moonofweisheng
PR: Moonofweisheng/wot-design-uni#737
File: src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue:25-25
Timestamp: 2024-11-26T02:35:53.123Z
Learning: 在 `wd-divider.vue` 文件(路径:`src/uni_modules/wot-design-uni/components/wd-divider/wd-divider.vue`)中,`props.customStyle` 是字符串类型,用于传递自定义的样式字符串。
🪛 LanguageTool
docs/en-US/component/root-portal.md
[grammar] ~1-~1: Use proper spacing conventions.
Context: ...ft:8px;" effect="plain">$LOWEST_VERSION$ Whether to break out of the page, used t...
(QB_NEW_EN_OTHER_ERROR_IDS_000007)
[grammar] ~3-~3: There might be a mistake here.
Context: ...l-tag> Whether to break out of the page, used to solve various fixed positioning...
(QB_NEW_EN_OTHER)
[grammar] ~3-~3: There might be a mistake here.
Context: ...o solve various fixed positioning issues, mainly used for making popups and overl...
(QB_NEW_EN_OTHER)
[grammar] ~3-~3: Use proper spacing conventions.
Context: ...nly used for making popups and overlays. :::tip Tip The root portal component onl...
(QB_NEW_EN_OTHER_ERROR_IDS_000007)
[grammar] ~6-~6: Correctly pair commas and coordinating conjunctions.
Context: ...t Mini Program, Alipay Mini Program, APPandH5` platforms. The component autom...
(QB_NEW_EN_OTHER_ERROR_IDS_000073)
[grammar] ~6-~6: Use proper spacing conventions.
Context: ...te implementation based on the platform: - H5: Uses teleport feature - **WeChat...
(QB_NEW_EN_OTHER_ERROR_IDS_000007)
[grammar] ~8-~8: There might be a mistake here.
Context: ...he platform: - H5: Uses teleport feature - **WeChat Mini Program and Alipay Mini...
(QB_NEW_EN_OTHER)
[grammar] ~9-~9: There might be a mistake here.
Context: ...ipay Mini Program**: Uses root-portal component - App: Uses renderjs implementation...
(QB_NEW_EN_OTHER)
[grammar] ~10-~10: There might be a mistake here.
Context: ...tal` component - App: Uses renderjs implementation - Other platforms: Not supported T...
(QB_NEW_EN_OTHER)
[grammar] ~11-~11: Place a period at the end of declarative sentences.
Context: ...ion - Other platforms: Not supported This feature is mainly used to solve the...
(QB_NEW_EN_OTHER_ERROR_IDS_000178)
[grammar] ~13-~13: There might be a mistake here.
Context: ...ng problems of popups in complex layouts, and is recommended only when needed. ::...
(QB_NEW_EN_OTHER)
[grammar] ~13-~13: Use proper spacing conventions.
Context: ...ts, and is recommended only when needed. ::: ## Basic Usage Use `wd-root-portal...
(QB_NEW_EN_OTHER_ERROR_IDS_000007)
[grammar] ~14-~14: Use proper spacing conventions.
Context: ...and is recommended only when needed. ::: ## Basic Usage Use wd-root-portal to ren...
(QB_NEW_EN_OTHER_ERROR_IDS_000007)
[grammar] ~16-~16: Use proper spacing conventions.
Context: ...ed only when needed. ::: ## Basic Usage Use wd-root-portal to render content t...
(QB_NEW_EN_OTHER_ERROR_IDS_000007)
[grammar] ~18-~18: Use proper spacing conventions.
Context: ...yle interference from parent components. html <wd-button type="primary" @click="show = true">Show Modal</wd-button> <wd-root-portal v-if="show"> <view class="modal"> <view class="modal-content"> <text>This is a global modal</text> <wd-button @click="show = false">Close</wd-button> </view> </view> </wd-root-portal> scss .modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; } .modal-content { background-color: #fff; padding: 20px; border-radius: 8px; text-align: center; } ## Slots | Name | Description ...
(QB_NEW_EN_OTHER_ERROR_IDS_000007)
[grammar] ~54-~54: Use proper spacing conventions.
Context: ...x; text-align: center; } ``` ## Slots | Name | Description ...
(QB_NEW_EN_OTHER_ERROR_IDS_000007)
docs/en-US/component/popup.md
[grammar] ~77-~77: Don’t hyphenate words unnecessarily.
Context: ...ntent ``` ## root-portal When the root-portal attribute...
(QB_NEW_EN_OTHER_ERROR_IDS_000042)
[grammar] ~77-~77: There might be a mistake here.
Context: ... ``` ## root-portal When the root-portal attribute is set ...
(QB_NEW_EN_OTHER)
[grammar] ~79-~79: Use articles correctly.
Context: ... node, which can avoid the influence of parent component's transform, filter and other...
(QB_NEW_EN_OTHER_ERROR_IDS_000004)
[grammar] ~79-~79: Use an Oxford comma.
Context: ...luence of parent component's transform, filter and other CSS properties on the fixed p...
(QB_NEW_EN_OTHER_ERROR_IDS_000014)
[grammar] ~79-~79: Use proper spacing conventions.
Context: ...s on the fixed positioning of the popup. Different platforms use different implem...
(QB_NEW_EN_OTHER_ERROR_IDS_000007)
[grammar] ~82-~82: There might be a mistake here.
Context: ...schemes: - H5: Use Vue 3's teleport feature - APP: Use renderjs to move element...
(QB_NEW_EN_OTHER)
[grammar] ~83-~83: There might be a mistake here.
Context: ...js to move elements to the uni-app root node - **WeChat Mini Program/Alipay Mini Pro...
(QB_NEW_EN_OTHER)
[grammar] ~84-~84: There might be a problem here.
Context: ...Mini Program/Alipay Mini Program**: Use root-portal component - Other platforms: root-portal feat...
(QB_NEW_EN_MERGED_MATCH)
[grammar] ~85-~85: Use articles correctly.
Context: ...portal component - Other platforms: root-portal feature is not supported ```html <wd-p...
(QB_NEW_EN_OTHER_ERROR_IDS_000004)
[grammar] ~85-~85: Place a period at the end of declarative sentences.
Context: ...**: root-portal feature is not supported html <wd-popup v-model="show" root-portal position="center" custom-style="height: 200px;" @close="handleClose"> <text class="custom-txt">I'm teleported to the root node</text> </wd-popup> :::tip Tip This feature is mainly used t...
(QB_NEW_EN_OTHER_ERROR_IDS_000178)
[grammar] ~94-~94: Use proper spacing conventions.
Context: ...commended to enable it only when needed. ::: ## Attributes | Attribute | Descri...
(QB_NEW_EN_OTHER_ERROR_IDS_000007)
[grammar] ~95-~95: Use proper spacing conventions.
Context: ...ended to enable it only when needed. ::: ## Attributes | Attribute | Description | ...
(QB_NEW_EN_OTHER_ERROR_IDS_000007)
🪛 Biome (1.9.4)
src/pages.json
[error] 1316-1317: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 1317-1317: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 1317-1318: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 1319-1320: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 1326-1326: Expected a property but instead found '// #ifdef MP'.
Expected a property here.
(parse)
[error] 1320-1326: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 1326-1326: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 1326-1327: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 1327-1327: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 1327-1328: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
⏰ 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: ESLint Check
🔇 Additional comments (62)
src/uni_modules/wot-design-uni/components/wd-col-picker/wd-col-picker.vue (1)
39-39: rootPortal 属性已在 types.ts 中定义在
src/uni_modules/wot-design-uni/components/wd-col-picker/types.ts:139已确认存在rootPortal: makeBooleanProp(false)属性传递正确,无需进一步修改。
src/uni_modules/wot-design-uni/components/wd-select-picker/wd-select-picker.vue (1)
45-45: LGTM!属性传递实现一致与
wd-col-picker组件保持一致的实现方式,正确地将rootPortal属性传递给wd-action-sheet组件。src/uni_modules/wot-design-uni/components/wd-curtain/wd-curtain.vue (1)
10-10: LGTM!正确传递给 popup 组件
wd-curtain组件正确地将rootPortal属性传递给了wd-popup组件,符合组件结构设计。src/uni_modules/wot-design-uni/components/wd-notify/wd-notify.vue (1)
9-9: LGTM!正确使用注入的状态对象
wd-notify组件通过state.rootPortal访问属性是正确的,因为该组件使用注入的状态对象模式而非直接的 props,符合通知组件的架构设计。src/uni_modules/wot-design-uni/components/wd-drop-menu-item/wd-drop-menu-item.vue (1)
16-16: LGTM!下拉菜单项正确支持根节点传送门正确地将
rootPortal属性传递给wd-popup组件,实现了下拉菜单项的根节点传送门支持。src/uni_modules/wot-design-uni/components/wd-number-keyboard/wd-number-keyboard.vue (1)
10-10: LGTM!正确实现了根节点传送门功能此变更正确地将
rootPortal属性传递给底层的wd-popup组件,与其他组件的实现模式保持一致。属性绑定语法符合 Vue 规范。src/pages/index/Index.vue (1)
97-101: 正确添加了根节点传送门演示页面条目新增的页面条目结构正确,遵循了现有的模式,并正确使用了国际化标题键。位置安排合理,放在基础组件分类下。
src/uni_modules/wot-design-uni/components/wd-calendar/wd-calendar.vue (1)
37-37: 正确实现了根节点传送门属性传递此变更正确地将
rootPortal属性从日历组件传递给wd-action-sheet组件,建立了完整的属性传递链:calendar → action-sheet → popup。实现与其他组件保持一致。src/uni_modules/wot-design-uni/components/wd-action-sheet/wd-action-sheet.vue (1)
12-12: 正确完成了根节点传送门属性传递链此变更正确地将
rootPortal属性传递给底层的wd-popup组件,完成了完整的属性传递链。属性绑定位置合适,与其他 popup 相关属性保持一致的排列。docs/.vitepress/locales/zh-CN.ts (1)
177-180: 正确添加了根节点传送门组件的文档导航新增的侧边栏条目结构完全符合现有模式,位置安排合理(在基础组件分类下),命名规范与其他组件保持一致。文档链接路径正确。
src/uni_modules/wot-design-uni/components/wd-message-box/wd-message-box.vue (2)
12-12: ✅ rootPortal 属性集成正确向
wd-popup组件正确传递了rootPortal属性,这与整个组件库的 rootPortal 功能集成保持一致。该功能可以解决因父元素 CSS 属性(如 transform、filter)导致的 fixed 定位失效问题。
12-12: LGTM! Root Portal 属性绑定正确正确地将
rootPortal属性传递给wd-popup组件,使得 MessageBox 组件能够支持根传送门功能来解决 fixed 定位问题。实现符合整体设计目标。src/uni_modules/wot-design-uni/global.d.ts (2)
97-97: ✅ 全局组件类型声明正确
WdRootPortal组件的全局类型声明添加正确,使其能够在 Vue 模板和开发工具中被识别。该声明与其他组件声明的格式和位置保持一致。
97-97: LGTM! 全局组件类型声明添加正确正确添加了
WdRootPortal组件的全局类型声明,使其能够在 Vue 模板和开发工具中被正确识别。声明语法和位置都符合项目规范。docs/.vitepress/locales/en-US.ts (1)
176-180: ✅ 文档导航结构更新正确在英文文档侧边栏中正确添加了 RootPortal 组件的导航条目,位置合理地放置在 Basic 组件分组中。链接路径和文本标签格式与其他条目保持一致。
src/uni_modules/wot-design-uni/components/wd-picker/wd-picker.vue (2)
40-40: ✅ rootPortal 属性传递正确向
wd-popup组件正确传递了rootPortal属性,与其他组件(如 message-box)的实现保持一致。这确保了 picker 组件也能利用根门户功能来解决固定定位问题。
40-40: LGTM! Root Portal 属性绑定一致且正确正确地将
rootPortal属性传递给wd-popup组件,实现与其他组件保持一致。这使得 Picker 组件能够支持根传送门功能。src/uni_modules/wot-design-uni/components/wd-datetime-picker/wd-datetime-picker.vue (2)
55-55: ✅ rootPortal 功能集成一致在
wd-popup组件上正确添加了:root-portal="rootPortal"属性绑定,与组件库中其他组件的 rootPortal 功能集成保持一致。这将使日期时间选择器的弹出层能够在根门户中渲染,解决固定定位失效问题。
55-55: LGTM! Root Portal 属性绑定实现正确正确地将
rootPortal属性传递给wd-popup组件,与项目中其他组件的实现保持一致。这使得 DatetimePicker 组件能够支持根传送门功能来解决 fixed 定位问题。src/uni_modules/wot-design-uni/components/wd-keyboard/wd-keyboard.vue (1)
10-10: rootPortal 属性已正确定义,准备合并
- 在
src/uni_modules/wot-design-uni/components/wd-keyboard/types.ts中已将rootPortal定义为makeBooleanProp(false)
无需其他修改,可合并。src/uni_modules/wot-design-uni/components/wd-curtain/types.ts (1)
68-71: 新增 rootPortal 属性定义正确
- 使用了正确的
makeBooleanProp(false)定义- JSDoc 注释清晰说明了属性用途
- 默认值为
false保证向后兼容性- 遵循了代码库中既有的属性定义模式
src/uni_modules/wot-design-uni/components/wd-col-picker/types.ts (1)
135-139: 类型定义实现正确新增的
rootPortal属性类型定义遵循了现有的代码模式,使用makeBooleanProp(false)设置默认值,注释清晰地说明了该属性的用途和跨平台实现方式。src/uni_modules/wot-design-uni/components/wd-notify/types.ts (1)
61-65: 类型定义实现一致且正确新增的
rootPortal属性类型定义与其他组件保持一致,使用标准的makeBooleanProp(false)模式。注释详细说明了该属性的用途和不同平台的实现方式。docs/en-US/component/keyboard.md (1)
216-216: 文档更新清晰完整root-portal 属性的文档描述清晰,格式与其他属性保持一致,很好地解释了该属性用于解决 fixed 定位失效问题的用途。
src/uni_modules/wot-design-uni/components/wd-picker/types.ts (1)
154-158: 属性实现符合代码规范rootPortal 属性的实现遵循了组件库的一致性模式:
- 使用 makeBooleanProp(false) 进行类型定义
- 注释详细说明了属性的用途和跨平台支持
- 代码格式规范,与其他属性保持一致
src/uni_modules/wot-design-uni/components/wd-select-picker/types.ts (1)
90-94: 实现保持跨组件一致性rootPortal 属性的实现与其他组件保持完全一致:
- 类型定义和默认值规范
- 注释说明详细且统一
- 解决了 fixed 定位问题的核心需求
docs/en-US/component/number-keyboard.md (1)
220-220: 文档保持一致性尽管该组件已被标记为即将废弃,但保持文档的一致性是好的做法。root-portal 属性的文档格式正确,描述清晰。
src/uni_modules/wot-design-uni/components/wd-popup/types.ts (1)
97-103: 核心组件实现恰当在 popup 组件中添加 rootPortal 属性是合理的,因为许多其他组件都依赖于 popup:
- 属性定义遵循组件库规范
- 注释详细说明了跨平台实现方案
- 作为基础组件,为其他组件提供了统一的 portal 支持
src/uni_modules/wot-design-uni/components/wd-datetime-picker/types.ts (1)
187-191: LGTM! rootPortal 属性实现完善新增的
rootPortal属性实现得很好:
- 遵循了现有的属性定义模式
- JSDoc 注释详细说明了跨平台实现方案
- 默认值
false保证了向后兼容性- 清晰解释了解决 fixed 定位失效问题的目的
docs/en-US/component/curtain.md (1)
98-98: LGTM! 文档格式规范新增的
root-portal属性文档遵循了现有格式规范,描述清晰地说明了其用途。版本占位符$LOWEST_VERSION$应该会在构建过程中被正确替换。docs/component/message-box.md (1)
277-277: LGTM! 中文文档添加规范
root-portal属性的中文文档添加得很规范,描述准确地说明了其解决 fixed 定位失效问题的用途,格式与现有文档保持一致。docs/component/picker.md (1)
275-275: LGTM! 文档保持一致性Picker 组件的
root-portal属性文档与其他组件保持了良好的一致性,中文描述准确,格式规范。docs/component/col-picker.md (1)
655-655: LGTM! 文档添加完整规范ColPicker 组件的
root-portal属性文档完善了整个功能的文档覆盖,与其他组件文档保持了完美的一致性,描述准确、格式规范。src/uni_modules/wot-design-uni/components/wd-drop-menu-item/types.ts (1)
74-78: 实现正确,代码结构清晰新增的
rootPortal属性实现规范:
- 使用了正确的
makeBooleanProp(false)工具函数- 注释详细说明了属性用途和平台支持情况
- 属性命名符合驼峰命名规范
- 在类型定义中的位置合理
docs/component/curtain.md (1)
98-98: 文档更新已确认,已替换版本号占位符
- 新增的
root-portal属性描述准确清晰,与其他组件文档保持一致- 已在
docs/目录全量搜索,不再存在$LOWEST_VERSION$占位符,说明已使用实际版本号替换批准此次文档更新
src/uni_modules/wot-design-uni/components/wd-calendar/types.ts (1)
184-188: 实现符合规范,与其他组件保持一致Calendar 组件中
rootPortal属性的实现正确:
- 类型定义和默认值设置正确
- 注释详细说明了跨平台解决方案
- 与其他组件的实现方式保持一致
src/uni_modules/wot-design-uni/components/wd-keyboard/types.ts (1)
78-82: 实现正确,代码维护性良好Keyboard 组件中
rootPortal属性的实现规范:
- 添加了尾随逗号,提升代码维护性
- 属性定义和注释与其他组件保持一致
- 使用了正确的工具函数和默认值
docs/component/datetime-picker.md (1)
321-321: 文档更新正确且一致DatetimePicker 组件文档中新增的
root-portal属性描述准确:
- 属性说明清晰明了
- 表格格式保持一致
- 与其他组件的文档风格统一
和之前提到的一样,需要确认
$LOWEST_VERSION$占位符的处理。docs/component/notify.md (1)
196-196: 文档更新正确,符合规范新增的
root-portal属性文档齐全,包含了清晰的说明、类型、默认值和版本信息。这个属性用于解决 fixed 定位失效问题,是一个有用的增强功能。src/uni_modules/wot-design-uni/components/wd-message-box/types.ts (2)
10-10: 导入语句更新正确正确导入了
makeBooleanProp函数,为新增的rootPortal属性提供支持。
136-141: 新增属性实现规范
rootPortal属性的实现符合组件库的开发规范:
- 使用
makeBooleanProp(false)创建布尔类型属性- 提供了详细的注释说明,包括用途和平台支持
- 默认值设置为
false,保持向后兼容性docs/en-US/component/message-box.md (1)
217-217: 英文文档更新正确新增的
root-portal属性文档完整,英文翻译准确,格式符合表格规范。与中文文档保持一致性。docs/.vitepress/config.mts (1)
4-4: 时间戳更新正确文件修改时间戳已正确更新。根据 AI 摘要,此更改将导航和侧边栏配置移动到了本地化文件中,这是一个合理的重构。
src/uni_modules/wot-design-uni/components/wd-action-sheet/types.ts (2)
109-109: 代码格式改进添加尾随逗号符合 JavaScript 对象格式规范,便于后续属性的添加和代码维护。
110-115: 新增属性实现规范
rootPortal属性的实现符合组件库的开发规范:
- 使用
makeBooleanProp(false)创建布尔类型属性- 提供了详细的注释说明,包括用途和平台支持说明
- 默认值设置为
false,保持向后兼容性- 注释格式统一,便于开发者理解
src/locale/en-US.json (1)
1612-1623: 本地化条目添加良好新增的英文本地化条目翻译准确,涵盖了 root portal 功能相关的 UI 文本。翻译与中文含义对应良好,遵循了现有的命名约定。
docs/component/number-keyboard.md (1)
239-239: lockScroll 描述改进更新后的 lockScroll 属性描述更加准确和详细,明确说明了锁定时蒙层内容也无法滚动的行为,这有助于开发者更好地理解该属性的作用。
tests/components/wd-root-portal.test.ts (1)
1-70: 测试覆盖合理且实用新增的 wd-root-portal 组件测试文件质量良好,考虑到了组件的平台特定实现特点。测试策略重点关注组件的基本挂载和功能验证,这对于具有条件编译特性的组件来说是合理的方法。
测试用例覆盖了:
- 组件基本属性验证
- 不同插槽配置
- 复杂内容渲染
代码结构清晰,注释说明了测试限制的原因。
src/subPages/rootPortal/Index.vue (1)
1-63: Root Portal 演示页面实现优秀新增的 root portal 演示页面质量很高,有效展示了组件的使用方法:
优点:
- 使用 Vue 3 script setup 语法,代码简洁现代
- 模态框样式实现标准,包含半透明遮罩和居中内容
- 正确使用了 wd-root-portal 组件
- 适当的 z-index 设置确保层级正确
- 使用国际化文本,符合项目规范
实现细节良好:
- 响应式状态管理简单有效
- SCSS 样式组织清晰
- 组件结构符合项目约定
这个演示页面为开发者提供了清晰的 root portal 使用示例。
docs/component/keyboard.md (2)
257-257: 文档描述改进很好!将
lockScroll属性的描述从简单的"是否锁定滚动"改为更详细的说明,让开发者更清楚地理解该属性的具体行为和影响范围。
260-260: Root Portal 属性文档完整且准确新增的
root-portal属性文档描述清晰,说明了其用途是解决 fixed 定位失效问题,并且与其他组件的文档保持一致。src/uni_modules/wot-design-uni/components/wd-number-keyboard/types.ts (2)
78-78: 语法一致性改进添加尾随逗号提高了代码的一致性,也便于后续添加新属性时的版本控制。
79-82: Root Portal 属性定义完善新增的
rootPortal属性定义包含了:
- 清晰的 JSDoc 注释说明用途
- 详细的平台支持说明(H5、APP、小程序)
- 正确的类型定义和默认值
实现规范且文档完整。
src/pages.json (1)
1314-1329: 页面配置正确且格式一致新增的
rootPortal页面配置遵循了项目中其他页面的标准格式:
- 正确的路径配置
- 平台特定的标题设置
- 支付宝小程序的垂直弹跳禁用配置
静态分析工具报告的解析错误是误报,因为它们无法识别 uni-app 的条件编译指令(
// #ifdef MP、// #endif),这些指令在 uni-app 项目中是标准且有效的。docs/component/root-portal.md (3)
1-14: 组件文档结构完整且说明清晰新的 Root Portal 组件文档包含了:
- 清晰的组件用途说明
- 详细的平台支持信息(微信小程序、支付宝小程序、APP、H5)
- 各平台的实现方式差异说明
- 合理的使用建议(仅在需要时使用)
文档结构规范,信息全面。
22-54: 示例代码实用且完整提供的使用示例包含了:
- 完整的 HTML 模板示例
- 对应的样式代码
- 实际的弹窗效果实现
示例代码展示了 Root Portal 的典型应用场景,有助于开发者理解和使用该组件。
57-61: API 文档简洁准确Slots 文档虽然简单,但准确说明了默认插槽的用途,符合该组件的设计理念。
src/uni_modules/wot-design-uni/components/wd-popup/wd-popup.vue (3)
2-33: Root Portal 模式实现正确Portal 模式的实现保持了原有弹窗的完整功能:
- 正确包装了 overlay 和 transition 组件
- 保留了所有事件监听器和属性传递
- 维持了插槽内容和关闭图标的渲染
实现方式确保了在 Portal 模式下弹窗行为的一致性。
36-65: 代码重复是合理的设计选择虽然模板代码在 Portal 和非 Portal 模式间存在重复,但这种设计:
- 确保了两种模式的完全隔离
- 避免了复杂的条件渲染逻辑
- 提高了代码的可读性和维护性
考虑到组件的复杂性和稳定性要求,这是一个合理的实现方案。
84-84: 组件导入正确正确导入了新的
wdRootPortal组件,遵循了项目的导入规范。docs/component/popup.md (1)
69-88: 文档完善清晰root-portal 功能的文档说明完整,清晰地解释了:
- 功能用途(解决 fixed 定位失效问题)
- 不同平台的实现方案
- 使用示例
- 使用建议
文档质量很好。
src/subPages/popup/Index.vue (1)
48-52: 嵌套弹窗示例实现出色这个示例很好地展示了 root-portal 功能的实际应用场景:
- 清晰对比了普通弹窗和使用 root-portal 的弹窗在嵌套场景下的表现差异
- 父弹窗关闭时正确清理子弹窗状态
- 包含了暗黑模式支持
示例代码质量高,有助于开发者理解 root-portal 的使用价值。
Also applies to: 82-110, 200-229
| "quan-ju-tong-zhi": "全局通知", | ||
| "xian-shi-tong-zhi": "显示通知", | ||
| "quan-ju-jia-zai": "全局加载", | ||
| "xian-shi-jia-zai": "显示加载", | ||
| "zhe-shi-yi-ge-quan-ju-tan-chuang": "这是一个全局弹窗", | ||
| "mo-tai-kuang-biao-ti": "模态框标题", | ||
| "zhe-shi-mo-tai-kuang-de-nei-rong": "这是模态框的内容", | ||
| "rootportal-title": "Root Portal 根节点传送门", | ||
| "ji-chu-yong-fa": "基本用法", | ||
| "xian-shi-ji-ben-tan-chuang": "显示基本弹窗", | ||
| "ji-ben-tan-chuang": "基本弹窗", | ||
| "zhe-shi-yi-ge-shi-yong-root-portal-de-ji-ben-tan-chuang-shi-li": "这是一个使用 root-portal 的基本弹窗示例", | ||
| "guan-bi": "关闭", | ||
| "zai-zhe-zhao-ceng-zhong-de-xiao-guo-dui-bi": "在遮罩层中的效果对比", | ||
| "bu-shi-yong-root-portal": "不使用 root-portal", | ||
| "ke-neng-shou-dao-fu-zu-jian-yang-shi-ying-xiang": "可能受到父组件样式影响", | ||
| "xian-shi-pu-tong-tan-chuang": "显示普通弹窗", | ||
| "shi-yong-root-portal": "使用 root-portal", | ||
| "bu-shou-fu-zu-jian-yang-shi-ying-xiang": "不受父组件样式影响", | ||
| "xian-shi-chuan-song-men-tan-chuang": "显示传送门弹窗", | ||
| "pu-tong-tan-chuang": "普通弹窗", | ||
| "chuan-song-men-tan-chuang": "传送门弹窗", | ||
| "que-ding": "确定", | ||
| "quan-ju-tong-zhi": "全局通知", | ||
| "xian-shi-tong-zhi": "显示通知", | ||
| "zhe-shi-yi-tiao-quan-ju-tong-zhi": "这是一条全局通知", | ||
| "quan-ju-jia-zai-zhuang-tai": "全局加载状态", | ||
| "xian-shi-jia-zai": "显示加载", |
There was a problem hiding this comment.
存在重复的本地化键值
以下键值在 JSON 文件中重复出现,这可能会导致本地化系统出现意外行为:
quan-ju-tong-zhi(第 1616 行和第 1639 行)xian-shi-tong-zhi(第 1617 行和第 1640 行)xian-shi-jia-zai(第 1619 行和第 1643 行)
建议为这些重复的键值使用不同的命名,或者复用已存在的键值。
🤖 Prompt for AI Agents
In src/locale/zh-CN.json around lines 1616 to 1643, there are duplicate
localization keys: "quan-ju-tong-zhi", "xian-shi-tong-zhi", and
"xian-shi-jia-zai". To fix this, rename the duplicated keys to unique names that
clearly differentiate their usage or remove the duplicates if they are
redundant, ensuring each key in the JSON file is unique to prevent conflicts in
the localization system.
| "ji-chu-yong-fa": "基本用法", | ||
| "xian-shi-ji-ben-tan-chuang": "显示基本弹窗", | ||
| "ji-ben-tan-chuang": "基本弹窗", | ||
| "zhe-shi-yi-ge-shi-yong-root-portal-de-ji-ben-tan-chuang-shi-li": "这是一个使用 root-portal 的基本弹窗示例", | ||
| "guan-bi": "关闭", | ||
| "zai-zhe-zhao-ceng-zhong-de-xiao-guo-dui-bi": "在遮罩层中的效果对比", | ||
| "bu-shi-yong-root-portal": "不使用 root-portal", | ||
| "ke-neng-shou-dao-fu-zu-jian-yang-shi-ying-xiang": "可能受到父组件样式影响", | ||
| "xian-shi-pu-tong-tan-chuang": "显示普通弹窗", | ||
| "shi-yong-root-portal": "使用 root-portal", | ||
| "bu-shou-fu-zu-jian-yang-shi-ying-xiang": "不受父组件样式影响", | ||
| "xian-shi-chuan-song-men-tan-chuang": "显示传送门弹窗", | ||
| "pu-tong-tan-chuang": "普通弹窗", | ||
| "chuan-song-men-tan-chuang": "传送门弹窗", | ||
| "que-ding": "确定", |
There was a problem hiding this comment.
🛠️ Refactor suggestion
复用已存在的本地化键值
以下新增的键值已经在文件中存在:
ji-chu-yong-fa(第 1624 行)已存在于第 1606 行guan-bi(第 1628 行)已存在于第 498 行que-ding(第 1638 行)已存在于第 948 行
建议直接使用已存在的键值,无需重复定义。
🤖 Prompt for AI Agents
In src/locale/zh-CN.json around lines 1624 to 1638, the keys "ji-chu-yong-fa",
"guan-bi", and "que-ding" are redefined but already exist earlier in the file at
lines 1606, 498, and 948 respectively. Remove these duplicate key definitions
from lines 1624 to 1638 and reuse the existing keys to avoid redundancy and
potential conflicts.
| beforeDestroy() { | ||
| // 清理,将元素移回原位置 | ||
| if (this.$ownerInstance.$el) { | ||
| (document.querySelector('uni-app') || document.body).removeChild(this.$ownerInstance.$el) | ||
| } | ||
| } |
There was a problem hiding this comment.
🛠️ Refactor suggestion
增强 renderjs 清理逻辑的健壮性
在 beforeDestroy 钩子中,直接调用 removeChild 可能会在元素已被移除或移动的情况下抛出错误。建议在移除前检查父元素。
beforeDestroy() {
// 清理,将元素移回原位置
- if (this.$ownerInstance.$el) {
- (document.querySelector('uni-app') || document.body).removeChild(this.$ownerInstance.$el)
+ if (this.$ownerInstance.$el && this.$ownerInstance.$el.parentNode) {
+ this.$ownerInstance.$el.parentNode.removeChild(this.$ownerInstance.$el)
}
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| beforeDestroy() { | |
| // 清理,将元素移回原位置 | |
| if (this.$ownerInstance.$el) { | |
| (document.querySelector('uni-app') || document.body).removeChild(this.$ownerInstance.$el) | |
| } | |
| } | |
| beforeDestroy() { | |
| // 清理,将元素移回原位置 | |
| if (this.$ownerInstance.$el && this.$ownerInstance.$el.parentNode) { | |
| this.$ownerInstance.$el.parentNode.removeChild(this.$ownerInstance.$el) | |
| } | |
| } |
🤖 Prompt for AI Agents
In src/uni_modules/wot-design-uni/components/wd-root-portal/wd-root-portal.vue
around lines 41 to 46, the beforeDestroy hook removes an element without
verifying if its parent exists, which can cause errors if the element was
already removed or moved. To fix this, check if the element's parentNode exists
before calling removeChild to ensure safe removal.
🤔 这个 PR 的性质是?(至少选择一个)
🔗 相关 Issue
💡 需求背景和解决方案
新增 root-portal 组件支持从页面中脱离出来,用于解决各种 fixed 失效问题
☑️ 请求合并前的自查清单
Summary by CodeRabbit
新功能
文档
测试
国际化
其他