Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: ✏️ 修复部分文档拼写错误 #911

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chen-ziwen
Copy link

@chen-ziwen chen-ziwen commented Feb 21, 2025

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

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

🔗 相关 Issue

看文档时发现了一些错误

💡 需求背景和解决方案

官方文档部分案例拼写错误,修正错误提高使用体验

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

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

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

Summary by CodeRabbit

  • Documentation
    • 优化了多个组件文档示例,统一了事件处理方法和变量命名,提高了文档的一致性和可读性。
    • 标准化了日历、复选框、折叠面板、数字输入、弹出框、标签栏及上传组件的示例,使操作指引更直观,并增强了输入的灵活性。

Copy link

vercel bot commented Feb 21, 2025

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 Feb 21, 2025 3:31am

Copy link

coderabbitai bot commented Feb 21, 2025

Walkthrough

此次 PR 对文档示例中的函数命名和变量进行了统一调整。主要修改包括将部分组件示例中的函数名(如 handleConfirm4handleChange1handleChange4)统一更改为 handleConfirmhandleChange,同时更新了部分参数声明和变量类型(如 ref 的类型调整以及 fileList1 重命名为 fileList)。此外,对 <wd-popup> 组件的 v-model 绑定变量也进行了标准化,确保各示例之间的一致性与清晰性。

Changes

文件路径 更改摘要
docs/component/calendar.md 将确认日期选择函数从 handleConfirm4 修改为 handleConfirm,并更新 @confirm 事件引用。
docs/component/checkbox.md, docs/component/collapse.md, docs/component/input-number.md, docs/component/popover.md, docs/component/tabbar.md 统一重命名事件处理函数(如将 handleChange1handleChange4 改为 handleChange),其中 input-number.md 同时更新了 ref 类型为 `number
docs/component/upload.md 将变量 fileList1 重命名为 fileList,同时将事件处理函数 handleChange1 修改为 handleChange
docs/component/popup.md 统一 <wd-popup> 组件中多个 v-model 绑定变量(如 show7show8 等)为单一变量 show,标准化弹窗状态管理。

Possibly related PRs

Suggested reviewers

  • Moonofweisheng

Poem

小兔跳跃在代码花园,
见识函数名称闪闪发光;
从旧名到新名轻轻转,
文档中统一显得格外亮。
编码漫步如春风,🐇
共庆简洁与明朗的方向!


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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.

Copy link

netlify bot commented Feb 21, 2025

Deploy Preview for wot-design-uni ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit e827d1b
🔍 Latest deploy log https://app.netlify.com/sites/wot-design-uni/deploys/67b7f345f076bc0008547347
😎 Deploy Preview https://deploy-preview-911--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 site configuration.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🔭 Outside diff range comments (1)
docs/component/upload.md (1)

46-47: ⚠️ Potential issue

变量命名不一致
在“双向绑定 1.3.8”示例中,使用了 v-model:file-list="fileList1",但对应的 TypeScript 代码中定义变量却为 fileList。建议统一为同一个变量名称(推荐使用 fileList),以避免示例中的混淆。

🧹 Nitpick comments (2)
docs/component/popup.md (1)

78-78: 建议: 动态设置页面 overflow 属性
使用 <page-meta :page-style="overflow:${show ? 'hidden' : 'visible'};"></page-meta> 组件动态控制页面滚动状态,有助于防止滚动穿透。建议在文档中增加对此配置的简短说明。

docs/component/upload.md (1)

149-151: 避免变量名冲突
在多个示例代码中的 handleChange 函数,参数解构时直接使用了 fileList,与外部定义的响应式变量 fileList 重名,容易引起混淆。建议将解构参数重命名为例如 files,从而提高代码示例的可读性。

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eb514f0 and e827d1b.

📒 Files selected for processing (8)
  • docs/component/calendar.md (2 hunks)
  • docs/component/checkbox.md (1 hunks)
  • docs/component/collapse.md (1 hunks)
  • docs/component/input-number.md (2 hunks)
  • docs/component/popover.md (1 hunks)
  • docs/component/popup.md (4 hunks)
  • docs/component/tabbar.md (2 hunks)
  • docs/component/upload.md (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
docs/component/input-number.md (1)
Learnt from: chen-ziwen
PR: Moonofweisheng/wot-design-uni#909
File: docs/component/input-number.md:93-98
Timestamp: 2025-02-20T12:31:40.241Z
Learning: In the InputNumber component documentation, function naming should be consistent across all examples, using `handleChange` instead of variations like `handleChange1`.
🔇 Additional comments (14)
docs/component/popup.md (4)

48-48: 建议: 统一“禁止遮罩点击”示例
在该示例中,通过添加 :close-on-click-modal="false" 明确防止点击遮罩关闭弹出层,示例清晰,符合预期。


57-57: 建议: 展示“禁用遮罩”示例
使用 :modal="false" 属性显示如何禁用遮罩层,该示例直观且易于理解。


66-66: 建议: 确保底部安全区展示无误
通过 :safe-area-inset-bottom="true" 属性防止弹出层被底部安全区遮挡,示例配置合理。


80-80: 建议: 锁定滚动效果演示
结合 lock-scroll 属性展示弹出层期间禁止页面滚动的效果,示例整体清晰。

docs/component/input-number.md (2)

15-17: 建议: 简洁实现输入值变更处理示例
handleChange 函数通过解构方式获取参数并打印 value,示例简单明了,适合作为基本用法展示。


95-97: 建议: 支持空值输入示例更新
ref 的类型由 number 修改为 number|string,允许传入空字符串,可更好地展示允许空值的使用场景,示例修改合理。

docs/component/popover.md (1)

27-29: 建议: 统一事件处理函数命名
将原本可能存在的 handleChange1 改为 handleChange,参数使用对象解构 { show } 后,示例说明清晰且统一,有助于文档一致性。

docs/component/tabbar.md (2)

123-129: 建议: 统一切换事件处理器写法
切换事件示例中,将 @change 事件处理器由旧名称更新为 handleChange 后,代码风格与其他组件保持一致,示例配置清晰。


137-139: 建议: 明确定义事件处理函数内部依赖
handleChange 函数中调用 show 方法应确保在当前上下文中已定义或在文档中予以说明,以防用户困惑。

docs/component/checkbox.md (1)

16-18: 建议: 统一复选框事件处理函数命名
将事件处理函数从 handleChange1 改为 handleChange,并通过解构获取 value,示例风格与其他组件一致,便于用户理解和使用。

docs/component/collapse.md (1)

150-156: 事件处理函数命名更新
此次修改将 <wd-collapse> 组件在“查看更多-使用插槽”示例中的 @change 事件处理函数由原来的 “handleChange4” 统一更新为 “handleChange”,与其它组件文档保持了一致性,提升了示例的标准化。

docs/component/calendar.md (2)

354-357: 更新确认事件示例
在该示例中,原本错误的或冗余命名 “handleConfirm4” 已更新为 “handleConfirm”,确保所有示例中对确认事件的处理函数名称一致,便于用户理解和调用。


363-366: 统一确认事件处理逻辑
更新后的 handleConfirm 函数通过调用 new Date(value).toString() 来更新展示值(formatValue)。请确认该转换逻辑能满足所有示例的使用场景,如有必要,可补充错误处理或格式化调整。

docs/component/upload.md (1)

22-23: 更新上传组件事件绑定
基本用法示例中,@change 事件绑定已更新为使用 “handleChange”,与其它文档示例统一,便于开发者理解上传组件的事件机制。

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.

1 participant