# Section 标题栏
概述
 Section 标题栏,主要用于文章、列表详情等标题展示。
# 支持平台
目前开发小程序与H5推荐使用 FirstUI nvue版本 (opens new window)。
| 安卓系统版本 | 安卓uni-app | 安卓uniapp-x | iOS系统版本 | iOS uniapp | iOS uniapp-x | 小程序 | H5/Web | 
|---|---|---|---|---|---|---|---|
| 5.0 | × | ✓ | 9.0 | × | × | × | ✓ | 
# 引入
以下介绍两种常用的引入方式。
 第一种:在页面中引用、注册
 import fuiSection from "@/components/firstui/fui-section/fui-section.uvue"
export default {
	components:{
		fuiSection
	}
}
 1
2
3
4
5
6
2
3
4
5
6
第二种:easycom组件规范
 传统vue组件,需要安装、引用、注册,三个步骤后才能使用组件。easycom将其精简为一步。
 First UI easycom配置请查看 快速上手。
如果不了解easycom,可先查看 官网文档 (opens new window)。
# 代码演示
部分示例演示,完整使用请参考示例程序以及文档API。
 基础使用
 通过 title 属性设置标题,descr 属性设置描述信息。
<fui-section title="Section" descr="Section 标题栏,主要用于文章、列表详情等标题展示。"></fui-section>
 1
装饰线条
 通过 isLine 属性设置是否显示装饰线条。
<fui-section title="装饰线条" :isLine="true"></fui-section>
 1
# Slots
| 插槽名称 | 说明 | 
|---|---|
| default | 标题左侧自定义内容 | 
| right | 标题右侧自定义内容 | 
| descr | 自定义描述内容 | 
# Props
| 属性名 | 类型 | 说明 | 默认值 | 平台差异说明 | 
|---|---|---|---|---|
| title | String | 标题内容 | - | - | 
| size | Number | 标题字体大小,单位rpx | 32 | - | 
| lineHeight | Number | 标题行高,单位rpx,默认与字体大小相等 | 0 | - | 
| color | String | 标题颜色 | #181818 | - | 
| fontWeight | String | 标题字重,仅支持 normal、bold、'400'、'700' | '700' | - | 
| descr | String | 描述文本 | - | - | 
| descrSize | Number | 描述文本字体大小 | 28 | - | 
| descrColor | String | 描述文本字体颜色 | #B2B2B2 | - | 
| descrTop | Number | 描述文本与标题的间距,单位rpx | 12 | - | 
| isLine | Boolean | 是否显示修饰线条 | false | - | 
| lineWidth | String | 线条宽度,需自行带单位 | 2px | - | 
| lineColor | String | 线条颜色 | #465CFF | - | 
| lineCap | String | 线条两端样式,可选值:square(直角)、circle(圆角) | circle | - | 
| lineRight | Number | 线条距离标题的距离 | 16 | - | 
| lineGap | Number | 线条上下间距,单位rpx,默认为0,与标题同高 | 0 | - | 
| background | String | 组件背景色 | transparent | - | 
| padding | String | 组件外层容器padding值,格式同css | 0 32rpx | - | 
| marginTop | Number | 组件 margin-top 值,单位rpx | 0 | - | 
| marginBottom | Number | 组件 margin-bottom 值,单位rpx | 0 | - | 
# Events
| 事件名 | 类型 | 说明 | 回调参数 | 
|---|---|---|---|
| @onclick | (event: string) => void | 点击标题时触发 | string:标题内容 | 
 
Section 标题栏