Skip to content

feat: ✨ 新增 root-portal 组件支持从页面中脱离出来,用于解决各种 fixed 失效问题 - #1155

Merged
Moonofweisheng merged 1 commit into
masterfrom
feature/root-portal
Jul 8, 2025
Merged

feat: ✨ 新增 root-portal 组件支持从页面中脱离出来,用于解决各种 fixed 失效问题#1155
Moonofweisheng merged 1 commit into
masterfrom
feature/root-portal

Conversation

@Moonofweisheng

@Moonofweisheng Moonofweisheng commented Jul 8, 2025

Copy link
Copy Markdown
Owner

🤔 这个 PR 的性质是?(至少选择一个)

  • 日常 bug 修复
  • 新特性提交
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • CI/CD 改进
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 代码重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

新增 root-portal 组件支持从页面中脱离出来,用于解决各种 fixed 失效问题

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

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

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

Summary by CodeRabbit

  • 新功能

    • 新增 Root Portal 组件,实现跨平台弹窗、模态框等内容的根节点传送,支持 H5、App、微信/支付宝小程序。
    • 多个组件(如 Popup、ActionSheet、Calendar、Curtain、DatetimePicker、ColPicker、DropMenuItem、Keyboard、MessageBox、Notify、NumberKeyboard、Picker、SelectPicker)新增 root-portal 属性,用于解决 fixed 定位失效等布局问题。
    • 页面和文档新增 Root Portal 示例和说明,支持多语言。
    • 新增嵌套弹窗、全局弹窗等演示用例。
  • 文档

    • 各组件文档补充 root-portal 属性说明与使用场景。
    • 新增 Root Portal 组件使用指南及平台差异说明。
    • 优化部分属性描述,完善中英文文档内容。
  • 测试

    • 新增 Root Portal 组件的基础挂载与插槽渲染测试用例。
  • 国际化

    • 中英文资源文件新增弹窗、通知、加载、Root Portal 等相关翻译。
  • 其他

    • 页面配置与导航结构同步更新,适配 Root Portal 相关内容。

@netlify

netlify Bot commented Jul 8, 2025

Copy link
Copy Markdown

Deploy Preview for wot-design-uni ready!

Name Link
🔨 Latest commit 0c0395d
🔍 Latest deploy log https://app.netlify.com/projects/wot-design-uni/deploys/686ce75e553c0f0008241712
😎 Deploy Preview https://deploy-preview-1155--wot-design-uni.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel

vercel Bot commented Jul 8, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wot-design-uni ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 9:39am

@coderabbitai

coderabbitai Bot commented Jul 8, 2025

Copy link
Copy Markdown

Walkthrough

本次更新为组件库引入了“根节点传送门(Root Portal)”能力,允许弹窗、通知、选择器等组件通过 rootPortal 属性脱离页面普通 DOM 层级,在多平台下解决 fixed 定位失效等层叠样式问题。相关属性已在多个组件及其类型定义、文档和国际化资源中补充,并新增了 Root Portal 组件、演示页面及单元测试。

Changes

文件/路径分组 变更摘要
docs/.vitepress/config.mts 移除导航和侧边栏配置。
docs/.vitepress/locales/en-US.ts
docs/.vitepress/locales/zh-CN.ts
侧边栏增加 RootPortal 组件导航项(中英文)。
docs/component/.md
docs/en-US/component/
.md
各组件文档增加 root-portal 属性说明,详述用途、类型、默认值及平台支持。
docs/component/root-portal.md
docs/en-US/component/root-portal.md
新增 Root Portal 组件文档,含用法、平台支持说明及示例。
src/locale/en-US.json
src/locale/zh-CN.json
新增多条与弹窗、通知、Root Portal 相关的国际化字符串。
src/pages.json 新增 rootPortal 页面配置,含平台区分的标题。
src/pages/index/Index.vue Widget 分类下新增 rootPortal 页面入口。
src/subPages/rootPortal/Index.vue 新增 Root Portal 基本用法演示页面。
src/subPages/popup/Index.vue 新增嵌套弹窗示例,演示普通弹窗与 root-portal 弹窗的层级差异。
src/uni_modules/wot-design-uni/components/wd-*/types.ts 各弹窗/选择器/通知/键盘等组件类型定义增加 rootPortal 属性,默认 false
src/uni_modules/wot-design-uni/components/wd-/wd-.vue 各相关组件模板向下传递 :root-portal="rootPortal",支持 portal 渲染模式。
src/uni_modules/wot-design-uni/components/wd-popup/wd-popup.vue Popup 组件根据 rootPortal 条件,切换普通渲染与 <wd-root-portal> 包裹渲染。
src/uni_modules/wot-design-uni/components/wd-root-portal/wd-root-portal.vue 新增 wd-root-portal 组件,支持 H5(teleport)、小程序(root-portal)、APP(renderjs)等。
src/uni_modules/wot-design-uni/global.d.ts 全局类型声明新增 WdRootPortal 组件。
tests/components/wd-root-portal.test.ts 新增 wd-root-portal 组件基础挂载与插槽渲染能力的单元测试。

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
Loading

Poem

🐰
传送门开新径,
弹窗不再被遮影。
Root Portal 跨平台,
层级混乱一扫净。
组件携手齐升级,
兔子欢跳贺新景!

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@petercat-assistant

Copy link
Copy Markdown

Walkthrough

新增了一个名为 root-portal 的组件,支持从页面中脱离出来,以解决各种 fixed 定位失效的问题。此功能主要用于弹窗、弹出层等场景,适用于微信小程序、支付宝小程序、APP 和 H5 平台。文档和演示代码也进行了相应更新。

Changes

文件 概要
docs/.vitepress/config.mts 删除了导航和侧边栏配置。
docs/.vitepress/locales/en-US.ts, docs/.vitepress/locales/zh-CN.ts 添加了 RootPortal 组件的文档链接。
docs/component/*.md 各组件文档中新增 root-portal 属性说明。
docs/component/root-portal.md, docs/en-US/component/root-portal.md 新增 Root Portal 组件文档。
src/locale/en-US.json, src/locale/zh-CN.json 更新了语言文件。
src/pages.json 添加了新页面配置。
src/pages/index/Index.vue, src/subPages/popup/Index.vue, src/subPages/rootPortal/Index.vue 更新了页面和子页面以支持 root-portal
src/uni_modules/wot-design-uni/components/*/types.ts 各组件类型中新增 rootPortal 属性。
src/uni_modules/wot-design-uni/components/*/*.vue 各组件模板中新增 root-portal 属性绑定。
src/uni_modules/wot-design-uni/components/wd-root-portal/wd-root-portal.vue 新增 wd-root-portal 组件实现。
tests/components/wd-root-portal.test.ts 新增 wd-root-portal 组件的测试用例。

beforeDestroy() {
// 清理,将元素移回原位置
if (this.$ownerInstance.$el) {
(document.querySelector('uni-app') || document.body).removeChild(this.$ownerInstance.$el)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-commenter

codecov-commenter commented Jul 8, 2025

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.88%. Comparing base (f3ccf3d) to head (0c0395d).

❗ 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     
Flag Coverage Δ
h5 80.88% <100.00%> (-4.41%) ⬇️
wd-action-sheet 91.43% <100.00%> (+0.96%) ⬆️
wd-backtop ?
wd-badge ?
wd-button ?
wd-calendar 77.11% <100.00%> (+0.29%) ⬆️
wd-calendar-view ?
wd-card ?
wd-cell ?
wd-cell-group ?
wd-checkbox ?
wd-checkbox-group ?
wd-circle ?
wd-col-picker 80.87% <100.00%> (+1.03%) ⬆️
wd-collapse ?
wd-config-provider ?
wd-count-down ?
wd-count-to ?
wd-curtain 81.40% <100.00%> (+2.61%) ⬆️
wd-datetime-picker 73.69% <100.00%> (+0.74%) ⬆️
wd-datetime-picker-view ?
wd-divider ?
wd-drop-menu ?
wd-fab ?
wd-floating-panel ?
wd-form ?
wd-gap ?
wd-grid ?
wd-grid-item ?
wd-icon ?
wd-img ?
wd-img-cropper ?
wd-index-anchor ?
wd-index-bar ?
wd-input ?
wd-input-number ?
wd-keyboard 90.64% <100.00%> (+0.74%) ⬆️
wd-layout ?
wd-loading ?
wd-loadmore ?
wd-message-box 84.40% <100.00%> (+0.76%) ⬆️
wd-navbar ?
wd-navbar-capsule ?
wd-notice-bar ?
wd-notify 85.23% <100.00%> (+2.08%) ⬆️
wd-number-keyboard 86.24% <100.00%> (+1.28%) ⬆️
wd-overlay ?
wd-pagination ?
wd-password-input ?
wd-picker 82.33% <100.00%> (+0.73%) ⬆️
wd-picker-view ?
wd-popover ?
wd-popup 87.05% <100.00%> (+2.77%) ⬆️
wd-progress ?
wd-radio ?
wd-radio-group ?
wd-rate ?
wd-resize ?
wd-root-portal 100.00% <100.00%> (?)
wd-search ?
wd-segmented ?
wd-select-picker 76.75% <100.00%> (+0.62%) ⬆️
wd-sidebar ?
wd-signature ?
wd-skeleton ?
wd-slider ?
wd-sort-button ?
wd-status-tip ?
wd-step ?
wd-steps ?
wd-sticky ?
wd-sticky-box ?
wd-swipe-action ?
wd-swiper ?
wd-swiper-nav ?
wd-switch ?
wd-tabbar ?
wd-table ?
wd-tag ?
wd-text ?
wd-textarea ?
wd-toast ?
wd-tooltip ?
wd-transition ?
wd-upload ?
wd-video-preview ?
wd-watermark ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jul 8, 2025

Copy link
Copy Markdown

组件测试摘要 (H5 平台)

测试时间: Tue Jul 8 09:42:04 UTC 2025

测试结果

组件 状态 覆盖率
wd-action-sheet ✅ 通过 91.43%
wd-calendar ✅ 通过 77.11%
wd-col-picker ✅ 通过 80.87%
wd-curtain ✅ 通过 81.4%
wd-datetime-picker ✅ 通过 73.53%
wd-keyboard ✅ 通过 90.64%
wd-message-box ✅ 通过 84.4%
wd-notify ✅ 通过 85.23%
wd-number-keyboard ✅ 通过 86.24%
wd-picker ✅ 通过 82.33%
wd-popup ✅ 通过 87.05%
wd-root-portal ✅ 通过 100%
wd-select-picker ✅ 通过 76.75%

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 组件文档内容全面,清楚地解释了组件用途、平台支持和使用方法。文档结构合理,代码示例实用。

建议进行以下小的改进:

  1. $LOWEST_VERSION$ 占位符替换为实际版本号
  2. 考虑在行间添加适当的空行以提高可读性
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

📥 Commits

Reviewing files that changed from the base of the PR and between f3ccf3d and 0c0395d.

📒 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

Comment thread src/locale/zh-CN.json
Comment on lines +1616 to +1643
"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": "显示加载",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

存在重复的本地化键值

以下键值在 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.

Comment thread src/locale/zh-CN.json
Comment on lines +1624 to +1638
"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": "确定",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ 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.

Comment on lines +41 to +46
beforeDestroy() {
// 清理,将元素移回原位置
if (this.$ownerInstance.$el) {
(document.querySelector('uni-app') || document.body).removeChild(this.$ownerInstance.$el)
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ 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.

Suggested change
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.

@Moonofweisheng
Moonofweisheng merged commit 372735a into master Jul 8, 2025
@Moonofweisheng
Moonofweisheng deleted the feature/root-portal branch July 8, 2025 09:45
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.

2 participants