Skip to content

fix: 🐛 修复 table 组件表头文字溢出样式异常的问题 - #1182

Closed
patienry wants to merge 1 commit into
Moonofweisheng:masterfrom
patienry:fix/table
Closed

fix: 🐛 修复 table 组件表头文字溢出样式异常的问题#1182
patienry wants to merge 1 commit into
Moonofweisheng:masterfrom
patienry:fix/table

Conversation

@patienry

@patienry patienry commented Jul 28, 2025

Copy link
Copy Markdown

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

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

🔗 相关 Issue

Fix #1058

💡 需求背景和解决方案

wd-table__header中设置了white-space: nowrap导致文字溢出样式异常
wd-table__value中增加条件编译,微信小程序中设置white-space: normal覆盖上述样式

修改前
{E8A14877-0757-41F1-AD2F-FF556F814416}

修改后
{E71B636B-A06F-4010-9911-393E3D8D56C1}

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

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

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

Summary by CodeRabbit

  • 样式
    • 针对 MP-WEIXIN 平台,优化了表格在多行省略显示时的文本换行效果,提升了表格内容的可读性。

@vercel

vercel Bot commented Jul 28, 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 28, 2025 6:22am

@coderabbitai

coderabbitai Bot commented Jul 28, 2025

Copy link
Copy Markdown

Walkthrough

本次更改在 .wd-table__value 元素的 ellipsis 修饰符下,针对 MP-WEIXIN 平台新增了条件样式,将 white-space 属性设为 normal,以覆盖默认行为,实现微信小程序端表头文字可换行显示。

Changes

Cohort / File(s) Change Summary
Table 组件样式适配 MP-WEIXIN
src/uni_modules/wot-design-uni/components/wd-table/index.scss
.wd-table__value.ellipsis 下,为 MP-WEIXIN 平台增加 white-space: normal 样式,优化表头文字溢出换行问题。

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Assessment against linked issues

Objective Addressed Explanation
微信小程序端 TableColumn 标题文字溢出时可换行显示,与 H5 一致(#1058

Poem

小兔挥笔改样式,
表头溢出不再急。
微信小程序也能换行,
省略点点显神奇。
代码轻盈如兔影,
用户体验乐无比! 🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 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 cade06f and 37865ca.

📒 Files selected for processing (1)
  • src/uni_modules/wot-design-uni/components/wd-table/index.scss (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
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#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-table/index.scss (2)

Learnt from: Moonofweisheng
PR: #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: #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 是字符串类型,用于传递自定义的样式字符串。

⏰ 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). (4)
  • GitHub Check: Generate Test Summary
  • GitHub Check: Redirect rules - wot-design-uni
  • GitHub Check: Header rules - wot-design-uni
  • GitHub Check: Pages changed - wot-design-uni
🔇 Additional comments (1)
src/uni_modules/wot-design-uni/components/wd-table/index.scss (1)

159-161: 修复 white-space 的覆盖逻辑 👍

ellipsis 修饰符下为 MP-WEIXIN 单独设置 white-space: normal,成功覆盖了 .wd-table__header 里的 nowrap,能够解决小程序端表头文字无法换行的问题,改动精确且无副作用。

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 generate unit tests to generate unit tests 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 Jul 28, 2025

Copy link
Copy Markdown

Deploy Preview for wot-design-uni ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 37865ca
🔍 Latest deploy log https://app.netlify.com/projects/wot-design-uni/deploys/688716db1bf24c0008ac906f
😎 Deploy Preview https://deploy-preview-1182--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.

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 上报] TableColumn标题文字溢出时没有换行

1 participant