Skip to content

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右侧是否显示向右箭头Booleantrue | falsefalse
type左侧装饰标记类型Stringline | pill | plain'line'
showLine是否显示左侧装饰竖线(type="line" 时生效)Booleantrue | falsetrue
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标题文字是否加粗Booleantrue | falsetrue

插槽说明 (Slots)

插槽名说明
default标题下方的内容主体区域
right右侧自定义操作或扩展区域
icon自定义图标插槽

事件说明 (Events)

事件名说明回调参数
click点击标题头部区域时触发(event: TouchEvent)
click-right点击右侧操作文字/箭头时触发(event: TouchEvent)

基于 MIT 协议开源发行

H5 模拟器 (section)☀️🔄