Skip to content

fix(doc): 修复官网文档示例代码块没有间距问题 - #959

Open
zjxzjw wants to merge 2167 commits into
Tencent:developfrom
zjxzjw:fix_doc
Open

fix(doc): 修复官网文档示例代码块没有间距问题#959
zjxzjw wants to merge 2167 commits into
Tencent:developfrom
zjxzjw:fix_doc

Conversation

@zjxzjw

@zjxzjw zjxzjw commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

🤔 这个 PR 的性质是?

勾选规则:
1.只要有新增参数,就勾选”新特性提交“
2.只修改内部bug,未新增参数,才勾选”日常 bug 修复“
3.其他选项视具体改动判断

  • [] 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

💡 需求背景和解决方案

  • 为 td-code-block 组件添加底部边距 16px
  • 设置代码块显示为块级元素
  • 确保代码块样式符合设计规范

原版
d43ec8f51f331159e5c7978ed9abc6bc

现版
e00855b9443b12ada5d19cb96e45dd7c

📝 更新日志

修复官网文档示例代码块没有间距问题

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

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

  • pr目标分支为develop分支,请勿直接往main分支合并
  • 标题格式为:组件类名: 修改描述(示例:TBottomTabBar: 修复iconText模式,底部溢出2.5像素)
  • ”相关issue“处带上修复的issue链接
  • 相关文档已补充或无须补充

Luozf12345 and others added 30 commits June 27, 2025 10:23
- 在 TDMultiLinkedPicker 和 TDPicker 中添加 keepSameSelection 参数
- 实现了在重新选择时保留相同选项的功能
- 更新了示例页面,增加了保留下一级选项的演示
- 在 TDCalendar 组件中添加 cellWidget 参数,用于自定义日期单元格组件
- 在 TDCalendarCell 组件中增加对自定义 cell 内容的支持
- 示例页面中添加自定义日期单元格的使用示例
- 在 TdDropdownMenu 组件中添加了 openMenu 和 closeMenu 方法- 将原有的 _openMenu 方法改为异步方法,并添加了返回类型
- 保留了原有的功能和逻辑
`TDDropdownMenu`: 添加打开和关闭菜单的公共方法
…ection

`TDPicker`: 支持切换时优先保持级联的选项值
`TDTable`: 表格支持行默认选中
`TDCalendar`: 支持自定义 cell 的组件
TDDropdownMenu: 嵌套路由场景 弹窗位置计算错误
RSS1102 and others added 25 commits April 9, 2026 14:57
* chore: update feedback and release apk qrcode

* chore: 更新 apk 下载地址

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
fix(text): 修复Web端文字垂直居中显示问题

- 针对Web端添加特殊的高度校准逻辑,避免行高过大导致的居中偏移
- 为Web端实现独立的垂直居中算法,基于实际文字高度动态计算padding
- 调整Web端文字实际占用高度计算方式,使用fontSize的0.9倍作为基准
- 添加Flutter版本兼容性处理,不同版本使用不同的微调系数
- 将Web端paddingRate统一设为0,改由新的居中逻辑处理
- 优化代码缩进格式,统一参数对齐方式
…#900) (Tencent#905)

* fix(tab-bar): fix icon color not changing on selection (fixes Tencent#900)

In iconText and icon types, icons were rendered without applying
selection-based color. Wrap icons with IconTheme so they receive
brandNormalColor when selected and textColorPrimary when unselected,
consistent with how text color is applied.

- Add IconTheme wrapper in `icon` branch of _constructItem
- Add IconTheme wrapper in `iconText` branch of _constructItem
- Add unit tests covering TC-01 to TC-07 (selected/unselected/
  switch/regression/boundary scenarios)
- Regenerate API docs via demo_tool/all_build.sh

Made-with: Cursor

* [autofix.ci] apply automated fixes

---------

Co-authored-by: zflyluo <zflyluo@tencent.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Revert "ci(test-build): 恢复3.x 编译测试 (Tencent#901)"

This reverts commit 792672b.

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* [autofix.ci] apply automated fixes (attempt 3/3)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* 组件前缀TD改为T

* 修改文件名前缀

* 重命名copyWithTThemeData方法

* refactor: 统一命名规范,td前缀改为t

* [autofix.ci] apply automated fixes

* fix: regenerate api md files with all_build.sh to match CI output

* fix: regenerate site README files to match CI-generated output

* fix: replace remaining TD prefixes in source code comments and generated docs

The autofix CI regenerates api md and README files from source code.
Source code comments still had TD prefixes (TDCheckbox, TDRadio, etc.)
which caused the generated docs to differ from the committed files.

* fix: remove old text._buildNormalTDText.txt after method rename

* fix: gitignore ephemeral dirs and untrack macOS generated files

These files contain machine-specific paths (FLUTTER_ROOT, etc.)
that change on every CI run, causing autofix to always detect diffs.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: 阿菜 Cai <jimmyrss1102@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* ci: 清理构建生成的 txt 文件

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* refactor(picker): 统一 TDatePicker/TMultiPicker/TMultiLinkedPicker 为单一 TPicker

核心变更:
- 新增 TPickerOption(label, value, disabled) 数据类,label/value 分离
- 新增 TPickerValue + TPickerLoadEvent 回调类型
- 重写 TPicker: 支持 List<List<TPickerOption>> 多列独立 + Map 联动模式
- 删除 t_date_picker.dart / t_multi_picker.dart (合并入 t_picker.dart)
- 删除 t_date_picker_page.dart (由 TPickerPage 替代)
- onChange 命名统一 (原 onChanged)
- 移除 onSelectedItemChanged 回调
- 移除 Header/弹窗逻辑 (解耦展示层)
- 保留 TItemWidget / no_wave_behavior 内部组件

API 设计:
- items: 数据源 (List 或 Map)
- initialValue: 初始选中值
- onChange: 选中回调 (TPickerValue)
- onLoad: 按需加载回调 (TPickerLoadEvent)
- height/itemCount/preloadThreshold: 尺寸与加载控制

文件结构:
picker/
  t_picker.dart           # 主组件 (307行)
  t_picker_option.dart    # 选项数据类
  t_picker_value.dart     # 回调类型
  t_item_widget.dart      # 项渲染组件 (复用)
  API_REFERENCE.md        # API 文档

* refactor(picker): 重构 API 并更新示例文档

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* feat(picker): 按需请求加载示例

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* refactor(picker): 优化选择器组件架构与功能

* [autofix.ci] apply automated fixes

* docs: 添加日期时间选择器 API 文档并优化代码格式

* [autofix.ci] apply automated fixes

* chore: 更新 picker 组件 API 生成配置

* [autofix.ci] apply automated fixes

* refactor(picker): 规范化类成员声明顺序

* chore: 添加测试覆盖率报告文件

* [autofix.ci] apply automated fixes

* fix(picker): 修复日期选择器天数计算及确认回调问题

* fix(calendar): 修复无年份或月份时日列刷新索引越界

* docs(picker): 更新选择器API文档及示例配置

* [autofix.ci] apply automated fixes

* test(picker): 更新测试用例并移除冗余注释

* fix(picker): 使用资源代理替换硬编码的取消确认文案

* [autofix.ci] apply automated fixes

* feat(picker): 补充生成 picker 相关 API

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat(harness): add harness tooling and issue workflow scripts

* docs(harness): site README policy and GitHub PR body template

Aligned with 5709639; .harness only (no regenerated .cursor).

* 删除冗余规则
* feat(harness): add harness tooling and issue workflow scripts

* docs(harness): site README policy and GitHub PR body template

Aligned with 5709639; .harness only (no regenerated .cursor).

* 删除冗余规则

* 补充pr提交模版
* ci(test-build): 注释掉 Flutter 3.16.9 测试

* ci: 移除注释掉的 Flutter 版本配置

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat(harness): add harness tooling and issue workflow scripts

* docs(harness): site README policy and GitHub PR body template

Aligned with 5709639; .harness only (no regenerated .cursor).

* 删除冗余规则

* 补充pr提交模版

* 添加code_reviewer子Agent

* chore(harness): issue 修复流程优先自动发起 PR

- workflow / entry skill:commit 后先 push + gh pr create,失败再提示本地步骤

- issue-fix-process 规则与 reference 对齐
* feat(harness): add harness tooling and issue workflow scripts

* docs(harness): site README policy and GitHub PR body template

Aligned with 5709639; .harness only (no regenerated .cursor).

* 删除冗余规则

* 补充pr提交模版

* 添加code_reviewer子Agent

* chore(harness): issue 修复流程优先自动发起 PR

- workflow / entry skill:commit 后先 push + gh pr create,失败再提示本地步骤

- issue-fix-process 规则与 reference 对齐

* docs(harness): issue 修复 PR 后补充 demo APK 验收建议
…t#948)

* fix(ci): replace blocked actions-cool workflow dependencies

Migrate preview publish to TDesignOteam maintain-one-comment, remove obsolete tdesign-site tooling, and bump tdesign-common submodule to develop.

* chore: remove commitlint configuration and related dependencies
…nt#947)

CalendarTrigger 已在 t_calendar.dart 定义并通过 tdesign_flutter.dart 导出,popup 文件无需重复声明。
* refactor(popup): reimplement `popup`

Co-authored-by: Cursor <cursoragent@cursor.com>

* [autofix.ci] apply automated fixes

* feat(popup): enhance TPopup functionality and documentation

* [autofix.ci] apply automated fixes

* refactor(popup): update TPopup implementation and remove deprecated documentation

* [autofix.ci] apply automated fixes

* refactor(popup): update TPopup usage across multiple components to use the new show method

* refactor(popup): improve parameter validation and update title handling in TPopup

* refactor(popup): streamline TPopupOptions usage by replacing placement parameters with dedicated methods

* docs(popup): update TPopup command to include TPopupHandle and improve documentation generation

* [autofix.ci] apply automated fixes

* refactor(popup): replace titleBuilder with titleWidget in TPopup options and components

* refactor(popup): update TPopupTrigger values for consistency across components

* refactor(popup): replace margin with inset parameters in TPopup options and components for better layout control

* refactor(popup): update TPopup and _PopupTracker to allow multiple handles and improve documentation

* refactor(popup): replace titleBuilder with titleWidget in multiple popup examples and documentation

* docs(popup): enhance documentation and improve close behavior in TPopup components

* refactor(popup): rename `duration` to `animationDuration` in TPopup options and related components for clarity

* fix(popup): demo error

* [autofix.ci] apply automated fixes

* refactor(popup): enhance interaction semantics and improve button handling in TPopup components

* refactor(popup): introduce modal behavior and update overlay handling in TPopup options

* [autofix.ci] apply automated fixes

* refactor(popup): simplify overlay closing rules and tighten validation

* [autofix.ci] apply automated fixes

* refactor(popup): update text and comments for clarity in overlay demo and documentation

* [autofix.ci] apply automated fixes
…Style` (Tencent#951)

* fix(popup): 在弹窗路由中恢复 Material 上下文,避免子树继承异常 DefaultTextStyle

* [autofix.ci] apply automated fixes
…nts (Tencent#950)

* feat(popup): add `useSafeArea` for edge placements

* [autofix.ci] apply automated fixes

* test(popup): 增加 useSafeArea 相关的边界测试用例

* demo(popup): 增加自定义位置、圆角比较和底部内置头部示例

* [autofix.ci] apply automated fixes

* feat(popup): 增加生命周期演示 Toast 以观察弹窗调用顺序

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* ci: use reusable issue ci file

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: 阿菜 Cai <jimmyrss1102@gmail.com>
* refactor(picker): 移除不必要的 onLoad 回调和 header 部分

 Tencent#921 之前添加了 `onLoad`,还没有发布版本所以移除的话不会造成 breaking change

* [autofix.ci] apply automated fixes

* feat(picker): 添加六级联动选择功能并优化加载提示

* demo(picker): 更新示例和优化六级联动选择功能

* demo(picker): 添加五级联动选择和月日联动功能

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
…#942)

* refactor(date-time-picker): 重构 TDateTimePicker 对齐 mobile-vue mode API

以 DateTimePickerSnapshot 为单一真相源,基于现有 TPicker 实现 mode 驱动列生成、showWeek 与范围钳制,并补充示例与单测。

Co-authored-by: Cursor <cursoragent@cursor.com>

* [autofix.ci] apply automated fixes

* Revert "refactor(date-time-picker): 重构 TDateTimePicker 对齐 mobile-vue mode API"

This reverts commit 6cfdc8b.

* Revert "Revert "refactor(date-time-picker): 重构 TDateTimePicker 对齐 mobile-vue mode API""

This reverts commit cea3a4b.

* feat(date-time-picker): add TDateTimePicker component with enhanced API and inline usage examples

* refactor(date-time-picker): enhance API documentation and assertions for DateTimePickerMode

* [autofix.ci] apply automated fixes

* feat(date-time-picker): rename defaultValue to initialValue for clarity and consistency across components

* [autofix.ci] apply automated fixes

* feat(date-time-picker): enhance localization support and improve week label formatting

* refactor( date-time-picker): 重构移除头部操作按钮

* [autofix.ci] apply automated fixes

* refactor(date-time-picker): replace onConfirm and onCancel with onChange for improved state management

* [autofix.ci] apply automated fixes

* refactor(date-time-picker): update initialValue handling and improve API documentation for clarity

* [autofix.ci] apply automated fixes

* chore(date-time-picker): enhance date-time picker API by updating initialValue handling and expanding available parameters

* [autofix.ci] apply automated fixes

* refactor(date-time-picker): 精简 TDateTimePickerValue API 并收敛 Legacy 路径

移除 fromDateTime/hasAllFields/isCompleteFor,补全文档与测试,修复 filterItems Legacy data 初始化 bug。

* [autofix.ci] apply automated fixes

* refactor(date-time-picker): 更新自定义范围示例,调整时间模式为秒并优化初始值处理

* chore: 修复注释错误

* Merge remote-tracking branch 'origin/develop' into rss1102/refactor/date-time-picker

* [autofix.ci] apply automated fixes

---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat(calendar): 新增 bottom 自定义区域并移除内置时间选择器

* [autofix.ci] apply automated fixes

* refactor(calendar): 重构示例代码并合并bottomExpanded属性

* [autofix.ci] apply automated fixes

* refactor(calendar): 提取动画常量并补充 bottom 文档说明

* refactor(calendar): 完善弹窗生命周期与底部区域响应式

* [autofix.ci] apply automated fixes

* chore(coverage): 移除已删除 t_date_picker 相关 lcov 记录

日历重构后 date_picker_model 与 t_date_picker 已不存在,清理残留覆盖率条目。

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor(calendar): enhance bottom area handling and assert conditions

* [autofix.ci] apply automated fixes

* fix(calendar): 新增日期时间选择器并重构日历示例

* refactor: 调整 TDateTimePicker 导出顺序

* feat(calendar): 重构弹窗API为TCalendar.showPopup并更新示例

* [autofix.ci] apply automated fixes

* refactor(calendar): 重构API使用DateTime替代时间戳

* fix(calendar): 修复日历越界及动画跳动并重构控制栏

* perf(calendar): 优化长距滚动性能并屏蔽中间月份回调

* refactor(calendar): 将选中态决策逻辑从 cell 上移至 state

* test(calendar): 更新日历组件测试以适配DateTime类型API

* fix(calendar): 修正范围选择点击时上报的语义类型

* [autofix.ci] apply automated fixes

* refactor(calendar): 精简农历日历示例代码

* feat(calendar): 添加自定义确认按钮支持并更新日历示例代码

* feat(calendar): 添加弹窗底部自定义区域支持,更新相关逻辑和测试用例

* [autofix.ci] apply automated fixes

* feat(calendar): 更新日历组件生成逻辑,添加 TCalendarInherited 支持并完善文档

* [autofix.ci] apply automated fixes

* feat(calendar): 更新日历组件以支持自定义单元格和副标题,重构相关逻辑

* [autofix.ci] apply automated fixes

* feat(calendar): 引入 LunarInfo 类以支持农历信息,更新日历组件逻辑和示例代码

* [autofix.ci] apply automated fixes

* Merge branch 'develop' into rss1102/refactor/calendar-bottom-slot

* refactor(calendar): remove draggable option from TCalendar and update documentation for showPopup method

* refactor(calendar): rename popupBottomBuilder and popupBottomExpanded to popupOverlayBuilder and popupOverlayExpanded, update documentation and examples accordingly

* [autofix.ci] apply automated fixes

* chore(calendar): 删除农历支持相关文档和示例代码

* [autofix.ci] apply automated fixes

* refactor(date-time-picker): 更新文档说明,明确组件间独立性与复用关系

* refactor(calendar): 更新区间选择说明,明确点击规则与禁用日期处理

* [autofix.ci] apply automated fixes

* refactor(calendar): 更新日历组件文档,明确浮层与选中逻辑

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* refactor(picker): 重命名文件和类名,提升代码可读性

- picker_column_wheel.dart → wheel_column.dart (PickerColumnWheel → WheelColumn)
- t_picker_items.dart → picker_data.dart (TPickerItems/TPickerColumns/TPickerLinked → PickerItems/PickerColumns/PickerLinked)
- t_picker_keys.dart → picker_keys.dart (TPickerKeys → PickerKeys)
- t_picker_normalize.dart → picker_normalize.dart (TPickerNormalize → PickerNormalize)
- t_item_widget.dart → picker_item.dart (TItemWidget → PickerItemWidget)
- t_picker_option.dart → picker_option.dart (TPickerOption → PickerOption)
- t_picker_value.dart → picker_value.dart (TPickerValue → PickerValue)
- no_wave_behavior.dart → wheel_behavior.dart (NoWaveBehavior → WheelBehavior)

同时更新外部引用组件 (date_time_picker, calendar) 的类名和 import 路径

* fix(picker): initialValue 改为 initState-only 语义,修复 onChange 反馈环把滚轮钉死

* [autofix.ci] apply automated fixes

* refactor(picker): 更新文档说明,增强 API 可读性与一致性

* [autofix.ci] apply automated fixes

* refactor(picker): 更新文档说明,增强联动模式与禁用状态的可读性

* [autofix.ci] apply automated fixes

* refactor(picker): 精简文档说明,优化数据源与构造方法的描述

* [autofix.ci] apply automated fixes
- 为 td-code-block 组件添加底部边距 16px
- 设置代码块显示为块级元素
- 确保代码块样式符合设计规范
@zjxzjw zjxzjw changed the title 修复官网文档示例代码块没有间距问题 Fix(doc): 修复官网文档示例代码块没有间距问题 Jun 11, 2026
@zjxzjw zjxzjw changed the title Fix(doc): 修复官网文档示例代码块没有间距问题 fix(doc): 修复官网文档示例代码块没有间距问题 Jun 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

完成

📱 APK 下载

tdesign-flutter-0.2.7-672.apk

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.