Skip to content
在新窗口打开实时预览

Line 分隔线 ​

用于分隔内容块的线条,支持横向与竖向两种方向、半像素细线以及实线/虚线/圆点样式。

平台兼容性 ​

H5App微信小程序支付宝小程序
√√√√

基础用法 ​

vue
<snake-line />
<snake-line color="#06D290" margin="20rpx 0" />

方向与线型 ​

vue
<!-- 竖向线条,length 表现为高度 -->
<snake-line direction="col" length="80" />
<!-- 虚线 / 圆点 -->
<snake-line border-style="dashed" />
<snake-line border-style="dotted" />

hairLine 默认开启,通过 transform: scaleY/scaleX(0.5) 实现跨端一致的半像素细线。

API ​

Props ​

参数说明类型默认值
color线条颜色string--snake-color-border
length长度,竖向表现为高度,可为百分比或 rpxstring100%
direction线条方向row | colrow
hairLine是否显示半像素细线条booleantrue
margin与上下左右元素的间距string0
borderStyle线条类型solid | dashed | dottedsolid
customClass / customStyle自定义类名和样式string | object | array''

主题变量 ​

变量名说明
--snake-color-border分隔线默认色

为 uni-app 商城与 CMS 场景设计