Skip to content

fix: 🐛 修复input、textarea组件placeholder样式在微信小程序无效的问题 - #944

Merged
Moonofweisheng merged 1 commit into
Moonofweisheng:masterfrom
RJQingHuan:master
Mar 14, 2025
Merged

fix: 🐛 修复input、textarea组件placeholder样式在微信小程序无效的问题#944
Moonofweisheng merged 1 commit into
Moonofweisheng:masterfrom
RJQingHuan:master

Conversation

@RJQingHuan

@RJQingHuan RJQingHuan commented Mar 13, 2025

Copy link
Copy Markdown
Collaborator

Closes: #943

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

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

🔗 相关 Issue

💡 需求背景和解决方案

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

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

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

Summary by CodeRabbit

  • 新增功能

    • 升级了输入框和文本域的占位符样式,以提供更统一、清晰的视觉体验,尤其在暗黑模式与错误状态下展现更佳效果。
  • 代码优化

    • 对样式部分进行微调和整理,提升整体代码整洁度和维护性。

@vercel

vercel Bot commented Mar 13, 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 Mar 13, 2025 9:08am

@coderabbitai

coderabbitai Bot commented Mar 13, 2025

Copy link
Copy Markdown

Walkthrough

此次变更主要针对 wot-design-uni 组件中输入框(wd-input)和文本区域(wd-textarea)的占位符样式。原有的 SCSS 文件中通过 @include e(placeholder) mixin 定义的占位符样式被移除,并引入了新的 placeholder.scss 文件,以统一管理占位符的默认、暗黑主题以及错误状态下的样式。此外,在相应的 Vue 组件中新增样式块以导入新的占位符样式文件,同时进行了一处格式化调整。

Changes

文件路径 更改摘要
src/.../wd-input/index.scss
src/.../wd-textarea/index.scss
移除了原有的 @include e(placeholder) mixin 调用,删除了输入框与文本区域中用于占位符样式的代码;其中 wd-input/index.scss 还移除了末尾多余的换行符。
src/.../wd-input/placeholder.scss
src/.../wd-textarea/placeholder.scss
新增独立的 SCSS 文件,用于定义占位符的默认样式、暗黑主题变体及错误状态下的颜色设置,保证样式的一致性。
src/.../wd-input/wd-input.vue
src/.../wd-textarea/wd-textarea.vue
在 Vue 组件中新增 <style> 块以引入新的 placeholder.scss 样式文件,扩展组件的占位符样式配置(wd-input.vue 使用 scoped 样式,而 wd-textarea.vue 则为非 scoped 样式)。

Possibly related PRs

Suggested reviewers

  • Moonofweisheng

Poem

我是一只跳跃的小兔子,
在代码的田野中欢快徜徉,
占位符的变更如春风拂面,
每一处改动都如此温柔,
错误与明亮在这里齐舞,
愿代码世界充满跳跃的希望! 🐇

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7478939 and 1c385f2.

📒 Files selected for processing (6)
  • src/uni_modules/wot-design-uni/components/wd-input/index.scss (1 hunks)
  • src/uni_modules/wot-design-uni/components/wd-input/placeholder.scss (1 hunks)
  • src/uni_modules/wot-design-uni/components/wd-input/wd-input.vue (1 hunks)
  • src/uni_modules/wot-design-uni/components/wd-textarea/index.scss (0 hunks)
  • src/uni_modules/wot-design-uni/components/wd-textarea/placeholder.scss (1 hunks)
  • src/uni_modules/wot-design-uni/components/wd-textarea/wd-textarea.vue (1 hunks)
💤 Files with no reviewable changes (1)
  • src/uni_modules/wot-design-uni/components/wd-textarea/index.scss
🔇 Additional comments (5)
src/uni_modules/wot-design-uni/components/wd-textarea/wd-textarea.vue (1)

286-289: 新增样式块导入 placeholder.scss
在此处新增的 <style> 块用于引入 placeholder.scss,确保文本域占位符在微信小程序中能正确显示。这种做法将占位符样式从原有的 index.scss 中剥离出来,符合模块化及样式统一管理的设计原则。

src/uni_modules/wot-design-uni/components/wd-input/wd-input.vue (1)

296-298: 新增样式块导入 placeholder.scss
通过添加新的 <style> 块引入 placeholder.scss,输入框的占位符样式将从原先散落的 mixin 定义中分离出来,统一由单独的 SCSS 文件管理,从而修复微信小程序中 placeholder 样式失效的问题。

src/uni_modules/wot-design-uni/components/wd-textarea/placeholder.scss (1)

1-21: 新增文本域占位符样式文件
此文件清晰地定义了文本域的占位符样式,包括默认状态、暗黑主题及错误状态下的样式。通过引用公共变量和 mixin,保证了样式的一致性与可维护性。检查路径和变量是否与项目统一规范,整体实现符合预期。

src/uni_modules/wot-design-uni/components/wd-input/placeholder.scss (1)

1-22: 新增输入框占位符样式文件
此 SCSS 文件为输入框定义了默认、暗黑主题和错误状态下的占位符样式。结构上采用了 BEM 命名和 mixin,保证了与设计系统其他组件风格的一致性。建议确认引入的公共变量与 mixin 均符合最新规范,整体实现良好。

src/uni_modules/wot-design-uni/components/wd-input/index.scss (1)

324-324: 移除占位符样式 mixin 的调整
已将原先在 index.scss 中通过 @include e(placeholder) 定义的占位符样式移除,将该部分样式拆分到新的 placeholder.scss 文件中管理。此改动符合整体样式统一的策略,请确保在各个状态(如错误、暗黑)下占位符样式能够正常显示,建议在微信小程序环境中进行全面验证。


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.
    • 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.
  • @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.

@netlify

netlify Bot commented Mar 13, 2025

Copy link
Copy Markdown

Deploy Preview for wot-design-uni ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 1c385f2
🔍 Latest deploy log https://app.netlify.com/sites/wot-design-uni/deploys/67d2a0324c0b230008edbdb9
😎 Deploy Preview https://deploy-preview-944--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.

@Moonofweisheng
Moonofweisheng merged commit 1ac115f into Moonofweisheng:master Mar 14, 2025
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.

[Bug 上报] wd-input和wd-textarea placeholder-class样式在微信小程序中不生效

2 participants