Section 标题
用于页面或表单大模块的章节标题控件,带有标志性的极奢立柱标记、副标题说明与右侧 Action 动作扩展槽。
代码示例
1. 基础章节标题 (Basic Section)
vue
<template>
<mu-section
title="1. 基础账号设置"
desc="管理您的个人资料、绑定邮箱与安全手机"
/>
</template>2. 右侧操作区插槽 (Right Slot)
vue
<template>
<mu-section title="热门推荐课程" desc="每日精选优质技术讲座">
<template #right>
<mu-button type="primary" size="small" plain>查看更多 ➔</mu-button>
</template>
</mu-section>
</template>3. 带图标与右侧箭头 (Icon + Arrow)
vue
<template>
<mu-section
title="账户安全"
desc="设置密码与双重认证"
icon="shield"
right-text="管理"
arrow
@click-right="onRightClick"
/>
</template>API 属性说明 (Props)
| 参数名 | 说明 | 类型 | 可选值 | 默认值 |
|---|---|---|---|---|
| title | 章节主标题文案 | String | - | '' |
| desc | 副标题/辅助说明文本 | String | - | '' |
| rightText | 右侧操作文字 | String | - | '' |
| arrow | 右侧是否显示向右箭头 | Boolean | true | false | false |
| type | 左侧装饰标记类型 | String | line | pill | plain | 'line' |
| showLine | 是否显示左侧装饰竖线(type="line" 时生效) | Boolean | true | false | true |
| lineColor | 左侧装饰竖线颜色 | String | - | ''(默认主题色) |
| icon | 标题左侧矢量图标名称 | String | - | '' |
| iconSize | 图标尺寸 (rpx) | Number | String | - | 20 |
| iconColor | 图标颜色 | String | - | '' |
| padding | 标题区域内边距 | String | - | '20rpx 0' |
| marginTop | 组件顶部外边距 (rpx) | Number | String | - | '0' |
| titleColor | 标题文字颜色 | String | - | '' |
| titleSize | 标题文字大小 (rpx) | Number | String | - | '' |
| bold | 标题文字是否加粗 | Boolean | true | false | true |
插槽说明 (Slots)
| 插槽名 | 说明 |
|---|---|
| default | 标题下方的内容主体区域 |
| right | 右侧自定义操作或扩展区域 |
| icon | 自定义图标插槽 |
事件说明 (Events)
| 事件名 | 说明 | 回调参数 |
|---|---|---|
| click | 点击标题头部区域时触发 | (event: TouchEvent) |
| click-right | 点击右侧操作文字/箭头时触发 | (event: TouchEvent) |