Skip to content

fix(input): 不需要加 get 属性的,用 nativeElement 就可了#3235

Merged
oasis-cloud merged 6 commits into
jdf2e:feat_v3.xfrom
xiaoyatong:feat3/input
May 30, 2025
Merged

fix(input): 不需要加 get 属性的,用 nativeElement 就可了#3235
oasis-cloud merged 6 commits into
jdf2e:feat_v3.xfrom
xiaoyatong:feat3/input

Conversation

@xiaoyatong

@xiaoyatong xiaoyatong commented May 23, 2025

Copy link
Copy Markdown
Collaborator

🤔 这个变动的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

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

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

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • fork仓库代码是否为最新避免文件冲突
  • Files changed 没有 package.json lock 等无关文件

Summary by CodeRabbit

  • 文档
    • 更新了 Input 组件文档,新增了布尔类型属性 plain,用于区分容器样式或文本样式输入框,默认值为 false
    • 将 Input 组件的 Ref 方法命名由 "get" 更名为 "nativeElement",功能描述保持不变。

@coderabbitai

coderabbitai Bot commented May 23, 2025

Copy link
Copy Markdown
## Walkthrough

本次变更统一了 Input 组件文档中 ref 方法的命名,将原先的 “get” 方法重命名为 “nativeElement”,涉及中英文及 Taro 版本文档,描述内容和参数保持不变,仅对方法名进行了规范化调整。同时新增了一个布尔型 prop `plain`,默认值为 false,用于描述输入框的样式类型。组件代码中也移除了 `get` 方法,仅保留 `nativeElement`## Changes

| 文件路径                                               | 变更摘要                                      |
|------------------------------------------------------|-----------------------------------------------|
| src/packages/input/doc.en-US.md<br>src/packages/input/doc.md<br>src/packages/input/doc.taro.md<br>src/packages/input/doc.zh-TW.md | 新增布尔型 prop `plain`(默认 false),用于区分输入框样式;将 Input 组件 ref 方法名由 “get” 重命名为 “nativeElement”,文档描述保持不变。 |
| src/packages/input/input.tsx<br>src/packages/input/input.taro.tsx | 组件内部移除 `get` 方法,仅保留 `nativeElement` 作为输入元素引用的访问方法。 |

## Possibly related PRs

- jdf2e/nutui-react#3229:该 PR 为 Input 组件添加了 “get” 方法并进行了文档说明,与本次 PR 对 ref 方法命名的变更直接相关,且两者命名方向相反。

## Suggested reviewers

- Alex-huxiyang
- oasis-cloud

## Poem

> 🐇  
> 文档小改动,名称换新颜,  
> “get” 变 “nativeElement”,统一更自然。  
> 兔子翻书页,细节也不乱,  
> 代码与文档,齐步向前看。  
> 🌱  
✨ 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.

@github-actions github-actions Bot added 3.x Target branch 3.x action:review This PR needs more reviews (less than 2 approvals) labels May 23, 2025
@xiaoyatong xiaoyatong changed the title Feat3/input fix(input): 不需要加 get 属性的,用 nativeElement 就可了 May 23, 2025
@codecov

codecov Bot commented May 23, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.15%. Comparing base (c20801d) to head (08f01d3).
Report is 4 commits behind head on feat_v3.x.

Additional details and impacted files
@@              Coverage Diff              @@
##           feat_v3.x    #3235      +/-   ##
=============================================
- Coverage      87.15%   87.15%   -0.01%     
=============================================
  Files            291      291              
  Lines          19222    19221       -1     
  Branches        2930     2930              
=============================================
- Hits           16753    16752       -1     
  Misses          2464     2464              
  Partials           5        5              

☔ 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.

@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: 0

🧹 Nitpick comments (2)
src/packages/input/doc.zh-TW.md (2)

129-145: 统一繁体术语
本段 Props 表格中存在简体字或用词不一致,建议做以下调整:

  • 将 “標簽” 改为 “標籤”
  • 将 “占位符” 改为 “佔位符”
  • 将 “限製” 改为 “限制”
🧰 Tools
🪛 LanguageTool

[locale-violation] ~133-~133: 'input' é un xenismo. É preferíbel dicir "entrada"
Context: ... | string | - | | type | 輸入框類型,支持原生 input 標簽的所有 type 屬性,另外還支持 number digit...

(GL_BARBARISM_REPLACE)


161-161: 增强 Ref 方法描述
nativeElement 在表格中描述为 “獲取當前容器”,建议调整为更精准易懂的:“獲取輸入框的原生 DOM 元素引用”。

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d8d4501 and 08f01d3.

📒 Files selected for processing (6)
  • src/packages/input/doc.en-US.md (2 hunks)
  • src/packages/input/doc.md (2 hunks)
  • src/packages/input/doc.taro.md (2 hunks)
  • src/packages/input/doc.zh-TW.md (2 hunks)
  • src/packages/input/input.taro.tsx (0 hunks)
  • src/packages/input/input.tsx (0 hunks)
💤 Files with no reviewable changes (2)
  • src/packages/input/input.tsx
  • src/packages/input/input.taro.tsx
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/packages/input/doc.en-US.md
  • src/packages/input/doc.taro.md
  • src/packages/input/doc.md
🧰 Additional context used
🪛 LanguageTool
src/packages/input/doc.zh-TW.md

[locale-violation] ~133-~133: 'input' é un xenismo. É preferíbel dicir "entrada"
Context: ... | string | - | | type | 輸入框類型,支持原生 input 標簽的所有 type 屬性,另外還支持 number digit...

(GL_BARBARISM_REPLACE)


[locale-violation] ~150-~150: 'input' é un xenismo. É preferíbel dicir "entrada"
Context: ...string) => void|-| | onClick | 點擊 input 容器觸發 |(value: MouseEvent<HTMLDivEleme...

(GL_BARBARISM_REPLACE)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: test

@xiaoyatong
xiaoyatong requested a review from oasis-cloud May 30, 2025 03:55
@oasis-cloud
oasis-cloud merged commit b96ec80 into jdf2e:feat_v3.x May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.x Target branch 3.x action:review This PR needs more reviews (less than 2 approvals) size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants