| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <template>
- <div class="adm-section-title" :class="{ 'is-plain': plain }">
- <span class="adm-section-title__bar"></span>
- <span class="adm-section-title__text">{{ title }}</span>
- <span v-if="desc" class="adm-section-title__desc">{{ desc }}</span>
- <span class="adm-section-title__extra">
- <slot />
- </span>
- </div>
- </template>
- <script>
- /**
- * SectionTitle —— 区块小标题
- *
- * 设计目的:卡片内「基础信息 / 高级配置 / 操作日志」等分区,
- * 目前各页用 el-divider、裸 div 或 h3 混写,缩进与字号不统一。
- *
- * 用法:
- * <SectionTitle title="基础信息" desc="必填项" />
- * <SectionTitle title="操作日志"><el-button size="mini">导出</el-button></SectionTitle>
- */
- export default {
- name: 'SectionTitle',
- props: {
- /** 区块标题 */
- title: { type: String, required: true },
- /** 右侧灰色补充说明 */
- desc: { type: String, default: '' },
- /** 无装饰竖线的纯文本样式 */
- plain: { type: Boolean, default: false }
- }
- }
- </script>
- <style scoped>
- .adm-section-title {
- display: flex;
- align-items: center;
- gap: 8px;
- margin: 4px 0 12px;
- }
- .adm-section-title__bar {
- flex: 0 0 auto;
- width: 3px;
- height: 14px;
- border-radius: 2px;
- background: var(--adm-primary);
- }
- .adm-section-title.is-plain .adm-section-title__bar {
- display: none;
- }
- .adm-section-title__text {
- font-size: 14px;
- font-weight: 600;
- line-height: 22px;
- color: #262626;
- }
- .adm-section-title__desc {
- font-size: 12px;
- color: #8c8c8c;
- }
- .adm-section-title__extra {
- margin-left: auto;
- display: flex;
- align-items: center;
- gap: 8px;
- }
- </style>
|