docs/archives/125-test-area-refactor/test-area-style-guide.md
本文档定义测试区域重构组件的统一样式规范,确保与Naive UI设计系统和左侧优化区域的视觉一致性。
NSpace vertical :size="16" - 用于组件间的主要分隔NSpace vertical :size="8" - 用于组件内部元素的分隔NFlex :size="12" - 用于按钮组或相关控件NFlex :size="8" - 用于密集布局的元素<!-- 主标题 (18px, 深度1) -->
<NText :depth="1" style="font-size: 18px; font-weight: 500;">主标题</NText>
<!-- 副标题/标签 (14px, 深度2) -->
<NText :depth="2" style="font-size: 14px; font-weight: 500;">标签文本</NText>
<!-- 帮助文本 (12px, 深度3) -->
<NText :depth="3" style="font-size: 12px;">帮助说明</NText>
<!-- 卡片标题 (16px, 加粗) -->
<NText style="font-size: 16px; font-weight: 600;">卡片标题</NText>
<!-- 水平布局 -->
<NFlex justify="space-between" align="center" :wrap="false">
<!-- 垂直布局 -->
<NFlex vertical :style="{ height: '100%' }">
<!-- 按钮组布局 -->
<NFlex align="center" :size="8">
<NGrid :cols="24" :x-gap="12" responsive="screen">
<NGridItem :span="8" :xs="24" :sm="8">
<!-- 内容 -->
</NGridItem>
</NGrid>
<!-- 固定高度容器 -->
:style="{ height: '100%' }"
<!-- 弹性收缩控制 -->
:style="{ flexShrink: 0 }"
<!-- 填充剩余空间 -->
:style="{ flex: 1, minHeight: 0 }"
NSpace vertical :size="8" 作为主容器depth="2", 14px, font-weight: 500depth="3", 12pxtype="tertiary", size="small", ghost, roundNGrid :cols="24" :x-gap="12" 响应式布局:size="8"type="primary",次要按钮 type="default"NCard size="small" 作为容器NCollapse 管理NFlex 水平布局,间距 gap: 12px16px, font-weight: 600NFlex verticalmarginBottom: '16px'<!-- 错误 -->
<div style="height: 200px; margin-bottom: 20px;">
<!-- 正确 -->
<div :style="{ marginBottom: '16px' }">
<!-- 错误 -->
<div class="flex flex-col h-full mb-4">
<!-- 正确 -->
<NFlex vertical :style="{ height: '100%', marginBottom: '16px' }">
<!-- 错误 -->
<div class="grid grid-cols-2 gap-4">
<!-- 正确 -->
<NGrid :cols="2" :x-gap="16">
遵循Naive UI响应式系统:
xs: < 576px (手机)sm: 576px (小屏幕)md: 768px (平板)lg: 992px (桌面)xl: 1200px (大屏幕)xxl: 1600px (超大屏幕)所有组件必须兼容:
组件样式验证清单: