开发预览 更新于 2026-05-10

TitleBar 标题栏

桌面应用窗口顶栏。macOS 风格 traffic light + 居中标题;Windows / Linux 风格 min/max/close 按钮 + 左对齐。

基础用法

platform="macos" 时左侧三个圆点(关闭 / 最小化 / 最大化)+ 居中标题; platform="windows" / 'linux' 时右侧三个按钮 + 左对齐标题。 头部默认 -webkit-app-region: drag,外层 Tauri / Electron 应用可拖拽窗口。

orders.parquetprotoforge
macOS · centered title
orders.parquetprotoforge
Windows · min / max / close
<CfTitleBar platform="macos" title="orders.parquet" subtitle="protoforge" :modified="true" />
<CfTitleBar platform="windows" title="orders.parquet" subtitle="protoforge" />
<CfTitleBar platform="macos" title="orders.parquet" subtitle="protoforge" modified />
<CfTitleBar platform="windows" title="orders.parquet" subtitle="protoforge" />

macOS / Windows / Linux 三平台

同一组件,platform 切视觉。hideControls=true 用作普通 header bar。

orders.parquetprotoforge
orders.parquetprotoforge
orders.parquetprotoforge
只标题(隐藏控件)
<CfTitleBar platform="macos" title="…" subtitle="…" :modified="true" />
<CfTitleBar platform="windows" title="…" subtitle="…" />
<CfTitleBar platform="linux" title="…" />
<CfTitleBar platform="macos" title="…" subtitle="…" modified />
<CfTitleBar platform="windows" title="…" subtitle="…" />
<CfTitleBar platform="linux" title="…" />

API

属性类型默认值说明
platform'macos' | 'windows' | 'linux''macos'视觉变体
title / subtitlestring
modifiedbooleanfalse显示未保存圆点
size'sm' | 'md' | 'lg''md'28 / 32 / 36 px
hideControlsbooleanfalse隐藏窗口控件,作为普通 header 用

事件:minimize / maximize / close

反馈与讨论

TitleBar 标题栏 的讨论

0
0 / 600
一键发送
正在加载评论...