Skip to content

Conversation

@xiaoxiaohuayu
Copy link

@xiaoxiaohuayu xiaoxiaohuayu commented Nov 28, 2025

Summary by CodeRabbit

发布说明

  • 新功能

    • 新增分割线组件,支持水平和竖直方向显示
    • 支持自定义颜色、厚度、虚线样式和发丝线效果
    • 支持文本内容和自定义插槽,可灵活配置内容位置
  • 文档

    • 完善分割线组件文档,包含详细的 API 说明和使用示例
    • 新增多个交互式示例展示颜色、虚线、厚度、方向等配置方式

✏️ Tip: You can customize this high-level summary in your review settings.

@netlify
Copy link

netlify bot commented Nov 28, 2025

Deploy Preview for skiyee-ui ready!

Name Link
🔨 Latest commit 23f1488
🔍 Latest deploy log https://app.netlify.com/projects/skiyee-ui/deploys/692967b446e95e00080de999
😎 Deploy Preview https://deploy-preview-46--skiyee-ui.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.

@coderabbitai
Copy link

coderabbitai bot commented Nov 28, 2025

功能概览

在 Skiyee UI 库中新增了分割线组件(Divider)的完整实现,包括 Vue 3 单文件组件、样式配置、类型定义、8 个示例页面和相应文档。该组件支持水平/竖直方向、自定义文本、颜色、粗细等多项配置选项。

变更

分组 / 文件 变更摘要
文档更新
docs/content/docs/2.components/1.basic/08.divider.md
移除 badge 字段;更新作者元数据(添加 avatar、to、target);修正 GitHub 链接路径;扩展内容为完整的使用示例和 API 文档,包含 CodePreview 和属性/插槽表。
分割线组件核心实现
packages/skiyee-uni-ui/src/components/sk-divider.vue
新增 Vue 3 分割线组件,支持水平/竖直方向、文本内容、自定义颜色(color/textColor)、线条粗细(thickness)、虚线(dashed)、细线(hairline)、内容位置(contentPosition)等 Props;定义公共 Props 和 Slots 接口。
样式系统
packages/skiyee-uni-ui/src/styles/sk-divider.ts
packages/skiyee-uni-ui/src/styles/index.ts
添加 SkDividerUcv 样式组件配置(基于 @skiyee/ucv),定义 orientation、dashed、contentPosition、hasContent 等变体;导出 SkDividerUcvProps 类型和 SkDividerUcv 组件。
示例页面集合
examples/uni/src/pages-basic/divider/base.vue
examples/uni/src/pages-basic/divider/color.vue
examples/uni/src/pages-basic/divider/dashed.vue
examples/uni/src/pages-basic/divider/hairline.vue
examples/uni/src/pages-basic/divider/position.vue
examples/uni/src/pages-basic/divider/text.vue
examples/uni/src/pages-basic/divider/thickness.vue
examples/uni/src/pages-basic/divider/vertical.vue
新增 8 个示例 Vue 单文件组件,分别展示基础用法、颜色定制、虚线、细线、内容位置、文本/插槽、线条粗细和竖直方向等各种配置方式。
配置与类型声明
examples/uni/src/pages.json
examples/uni/types/components.d.ts
examples/uni/types/pages.d.ts
添加 8 个分割线相关页面到 subPackages;在 GlobalComponents 中声明 SkDivider 组件;扩展 NavigateToOptions 类型并添加 8 条新路由字面量类型。

估计代码审查工作量

🎯 3 (中等) | ⏱️ ~25 分钟

  • 重点关注
    • packages/skiyee-uni-ui/src/components/sk-divider.vue 中新组件的完整 Props、Slots、计算属性和模板逻辑实现细节
    • packages/skiyee-uni-ui/src/styles/sk-divider.ts 中样式变体配置的正确性和覆盖范围
    • 各示例页面中对组件 Props 的正确使用和展示逻辑
    • 文档内容的准确性和示例代码的可执行性

诗文

🐰 ✨ 一条新分割线悄然而至,
横竖皆可,色彩随心~
细线粗线,虚实交织,
示例八般,文档齐全,
Skiyee UI 又添新彩!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR标题准确概括了核心变更:实现分割线组件。标题简洁明了,直接反映了这个PR的主要目标。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

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

🧹 Nitpick comments (3)
packages/skiyee-uni-ui/src/styles/sk-divider.ts (1)

20-41: vertical 模式下 root 同时有 w-fullinline-flex,建议拆分宽度/布局职责

当前 element.root 带有 w-full flex,而 orientation.vertical.root 再加上 inline-flex。在纵向模式里,分割线更像内联元素,将 w-full 固定在 base 上可能导致宽度比预期更大,同时 flex/inline-flex 并存也略显多余。

可以考虑把“占满宽度 + flex 布局”的职责下放到 horizontal 变体里,让 vertical 更紧凑一些,例如:

   element: {
-    root: 'sk-element:w-full flex items-center text-description sk-unit:py-12',
+    root: 'sk-element:w-full items-center text-description sk-unit:py-12',
@@
   variants: {
     orientation: {
       horizontal: {
-        root: 'w-full flex-row',
+        root: 'w-full flex flex-row',
@@
       vertical: {
-        root: 'inline-flex flex-col items-center gap-2 sk-unit:px-8',
+        root: 'inline-flex flex-col items-center gap-2 sk-unit:px-8',
       },

这样 horizontal 仍然保持全宽布局,而 vertical 在 flex 容器中表现会更符合“内联分割线”的直觉。

docs/content/docs/2.components/1.basic/08.divider.md (1)

185-197: Orientation 示例中 :thickness="2" 在默认 hairline=true 下其实不起作用,容易让人误解

根据组件实现,hairlinetrue 时会强制使用 1px 粗细,只有关闭 hairlinethickness 才真正生效。当前 Orientation 示例第二个纵向分割线写了 dashed :thickness="2",但未设置 :hairline="false",读者可能以为厚度已经被改成 2px。

可以考虑其一:

  • 若仅想展示“虚线 + 不同高度”,直接去掉 :thickness="2"
  • 若确实想对比 1px 与 2px 的粗细,可改为:
-    <SkDivider orientation="vertical" dashed :thickness="2" length="48px" />
+    <SkDivider orientation="vertical" dashed :hairline="false" :thickness="2" length="48px" />

这样行为与“Thickness/Hairline” 小节的说明完全一致。

packages/skiyee-uni-ui/src/components/sk-divider.vue (1)

74-90: inheritAttrs: false 下未透传 attrs,考虑可选地把外部 attrs 合并到根节点

现在设置了 inheritAttrs: false,但没有使用 useAttrs 手动透传,这意味着调用方无法给 SkDivider 直接添加 class/style/id/data-* 等 DOM 属性,只能通过 props(特别是 clax)间接控制样式。如果库内其它组件普遍支持透传 attrs,这里可能稍微有点反直觉。

如果希望既保留虚拟节点/多根等控制,又允许透传 attrs,可以考虑类似下面的方式:

-<script setup lang="ts">
-import { computed } from 'vue'
+<script setup lang="ts">
+import { computed, useAttrs } from 'vue'

@@
 const props = withDefaults(defineProps<SkDividerProps>(), {
   orientation: 'horizontal',
   contentPosition: 'center',
   dashed: false,
   hairline: true,
 })
+
+const attrs = useAttrs()
@@
-  <div :class="classes.root()" :style="rootStyle">
+  <div v-bind="attrs" :class="classes.root()" :style="rootStyle">

这样既不会影响现有 props 行为,又能让调用方在需要时用 class/data-xxx 等方式做细粒度定制。若当前库有统一的 attrs 处理规范,也可以根据现有组件保持一致即可。

Also applies to: 172-191

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a1d5cd3 and 23f1488.

📒 Files selected for processing (15)
  • docs/content/docs/2.components/1.basic/08.divider.md (1 hunks)
  • examples/uni/src/pages-basic/divider/base.vue (1 hunks)
  • examples/uni/src/pages-basic/divider/color.vue (1 hunks)
  • examples/uni/src/pages-basic/divider/dashed.vue (1 hunks)
  • examples/uni/src/pages-basic/divider/hairline.vue (1 hunks)
  • examples/uni/src/pages-basic/divider/position.vue (1 hunks)
  • examples/uni/src/pages-basic/divider/text.vue (1 hunks)
  • examples/uni/src/pages-basic/divider/thickness.vue (1 hunks)
  • examples/uni/src/pages-basic/divider/vertical.vue (1 hunks)
  • examples/uni/src/pages.json (2 hunks)
  • examples/uni/types/components.d.ts (1 hunks)
  • examples/uni/types/pages.d.ts (1 hunks)
  • packages/skiyee-uni-ui/src/components/sk-divider.vue (1 hunks)
  • packages/skiyee-uni-ui/src/styles/index.ts (1 hunks)
  • packages/skiyee-uni-ui/src/styles/sk-divider.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/skiyee-uni-ui/src/styles/sk-divider.ts (1)
packages/skiyee-uni-ui/src/styles/index.ts (2)
  • SkDividerUcv (25-25)
  • SkDividerUcvProps (24-24)
🔇 Additional comments (13)
examples/uni/src/pages-basic/divider/base.vue (1)

1-6: 代码看起来不错!

这个基础示例清晰地展示了 SkDivider 组件的默认用法。

examples/uni/src/pages-basic/divider/position.vue (1)

1-7: 代码看起来不错!

很好地演示了 content-position 属性的三种对齐方式(start、center、end),文案描述也与实际效果相符。

examples/uni/types/components.d.ts (1)

15-15: 代码看起来不错!

SkDivider 组件的类型声明正确,遵循了项目现有的类型定义模式。

examples/uni/src/pages-basic/divider/dashed.vue (1)

1-6: 代码看起来不错!

清晰地展示了虚线分割线的用法,包括带文字和不带文字两种场景。

examples/uni/src/pages.json (1)

110-141: 代码看起来不错!

8 个分割线示例页面的路由配置正确,格式统一,与项目现有的页面配置保持一致。

examples/uni/src/pages-basic/divider/hairline.vue (1)

1-7: 代码看起来不错!

很好地展示了发丝线功能的不同配置:默认发丝线、关闭发丝线、以及关闭发丝线后自定义粗细。示例清晰易懂。

examples/uni/src/pages-basic/divider/text.vue (1)

1-36: 代码看起来不错!

这个示例文件非常全面,展示了 SkDivider 组件的多种用法:

  • 文本标签与对齐方式(start/center/end)
  • 颜色自定义(分割线颜色和文字颜色)
  • 插槽自定义内容(图标、时间标签、状态徽章)

示例涵盖了从基础到高级的各种实际应用场景,对开发者很有参考价值。

examples/uni/src/pages-basic/divider/thickness.vue (1)

4-5: Based on my thorough investigation of the repository, I've discovered a critical issue with the review comment:

The file and component referenced in the review do not exist in the repository.

Verification findings:

  • ✗ File examples/uni/src/pages-basic/divider/thickness.vue does NOT exist
  • ✗ Component sk-divider.vue does NOT exist in packages/skiyee-uni-ui/src/components/
  • ✓ Confirmed: pages-basic directory contains only: badge, button, icon, overlay, roller (no divider)
  • ✓ Confirmed: No sk-divider component is implemented in the codebase

The review comment cannot be verified because it references a non-existent file and a non-existent component.

Likely an incorrect or invalid review comment.

examples/uni/src/pages-basic/divider/color.vue (1)

1-6: 示例用法与组件 API 一致

三个示例分别覆盖纯色、自定义文字颜色和粗线条场景,props 写法与文档说明和组件实现保持一致,没有发现问题。

packages/skiyee-uni-ui/src/styles/index.ts (1)

24-25: 在样式入口导出 Divider UCV 很合理

新增的 SkDividerUcvSkDividerUcvProps 导出与现有 Badge/Button 等组件的导出风格一致,方便外部复用,无需调整。

examples/uni/src/pages-basic/divider/vertical.vue (1)

1-8: 纵向分割线示例配置清晰

示例很好地展示了纵向分割线的基本用法和虚线/长度组合,props 与组件实现和文档描述一致,看起来没有问题。

examples/uni/types/pages.d.ts (1)

30-37: 为 Divider 新增路由字面量与示例路径一致

新增的 /pages-basic/divider/* 路径与示例页面及文档中的 CodePreview 路径保持一致,类型扩展正确。

packages/skiyee-uni-ui/src/components/sk-divider.vue (1)

20-66: 组件 API 与内部实现基本对齐,核心逻辑看起来是自洽的

  • Props 定义与文档里的 Props 表格一一对应(含 text/color/textColor/orientation/contentPosition/dashed/hairline/thickness/length/clax),默认值通过 withDefaults 与注释保持一致。
  • hasContent 结合插槽和 text 判定、再传给样式层的 hasContent variant,能很好地在“纯线条”和“带内容”两种场景间切换。
  • thickness 与 hairline 的关系(hairline 优先、关闭后才尊重 thickness)也与文档说明一致。

目前没有看到明显的逻辑/类型错误,这部分可以放心合入。

Also applies to: 85-113, 125-162, 172-191

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