Skip to content

t-line

Line 线条

组件介绍

线条组件,用于绘制线条,支持多种配置,包括线条大小、长度、方向、是否为细边框以及边框样式。

平台兼容

HarmonyH5AndroidiOS小程序UTS

基础用法

vue
<template>
  <view class="line-demo">
    <t-text>上方内容</t-text>
    <t-line></t-line>
    <t-text>下方内容</t-text>
    
    <t-line direction="column" length="100rpx"></t-line>
    
    <t-line lineStyle="dashed"></t-line>
    <t-line lineStyle="dotted"></t-line>
    <t-line lineSize="2px"></t-line>
  </view>
</template>

<style scoped>
.line-demo {
  padding: 20rpx;
}
</style>

Props

属性名类型默认值说明可选值
sizeString""组件尺寸large, medium, small, mini
typeString""组件类型info, primary, error, warning, success
disabledBooleanfalse组件是否禁用true, false
hoverBooleanfalse是否有点击效果true, false
pathString""点击组件后跳转的页面路径-
effectString""组件显示主题normal, dark, light, plain
lineSizeString"1px"线条的粗细-
lengthString"auto"线条的长度-
directionString"row"线条的方向row, column
hairlineBooleantrue是否使用细线条0.5pxtrue, false
lineStyleString"solid"线条的类型solid, dashed, dotted, double

Events

事件名说明回调参数
click点击时触发-
transitionend动画结束时触发-
initFinished组件初始化完成触发组件的节点信息
touchstart触摸开始时触发触摸事件对象
touchend触摸结束时触发触摸事件对象
touchmove触摸移动时触发触摸事件对象
touchcancel触摸取消时触发触摸事件对象

Slots

插槽名说明
default内容插槽,用于在线条中放置内容

LineStyle 说明

类型说明
solid实线
dashed虚线
dotted点状线
double双横线