Files
zkxw/docs/my-material-usage-tab-demos/05-inline-header.html
T
2026-06-15 18:19:57 +08:00

53 lines
2.3 KiB
HTML

<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>05 标题行内嵌 Tab · 我的物料领用记录 Tab Demo</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="_shared.css" />
<style>
.btn { height: 36px; padding: 0 14px; border-radius: 8px; font-size: 13px; font-weight: 500; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.panel-top--inline h2 { margin: 0; }
</style>
</head>
<body>
<header class="demo-banner">
<div>
<h1><span class="demo-badge">05 标题行内嵌 Tab</span> 我的物料领用记录 · Tab 样式 Demo</h1>
<p>Tab 放在标题右侧同一行 · 节省纵向空间</p>
</div>
<div class="demo-banner__actions">
<a href="index.html">← 选型索引</a>
</div>
</header>
<div class="page-wrap">
<section class="panel" id="panel-root">
<div class="panel-top panel-top--inline">
<h2 class="title-bar-heading">我的物料领用记录</h2>
<nav class="tabs-05" role="tablist">
<button type="button" class="tab-btn is-active" data-tab="usage" role="tab">领用记录</button>
<button type="button" class="tab-btn" data-tab="consumption" role="tab">消耗明细</button>
</nav>
</div>
<div class="tab-panel is-active" data-panel="usage" id="content"></div>
</section>
<p class="style-note">
<strong>紧凑方案:</strong>Tab 与标题同行,形成「页面名 + 视图切换」的组合,减少 Tab 被筛选区「淹没」的风险。
<div class="pros-cons">
<div class="pro">✓ 不额外占用纵向空间、Tab 与标题关联紧密</div>
<div class="con">✗ 窄屏下可能换行;标题较长时右侧空间紧张</div>
</div>
</p>
</div>
<script src="_demo-shell.js"></script>
<script>
document.getElementById('content').innerHTML = mockContent('usage')
initPanelTabs('panel-root')
</script>
</body>
</html>