Skip to content

Divider 分割线

支持平台

安卓iosweb微信小程序支付宝小程序QQ小程序
xxx

示例

html
<template>
	<t-page class="p.30" title="分割线">
		<t-card class="mb.30" title="Divider 分割线" sub-title="内容进行分割展示"></t-card>
		<t-section title='功能展示' type='p' class="tdb-tdr"></t-section>
		<t-col class="mt.30-tdr-tdb-plr.100-pt.30">
			<t-divider class="mb.30" :line="line" :dot="isdot" :lineStyle="lineStyle">{{text}}</t-divider>
			<t-divider class="mb.30" :line="line" :dot="isdot" type="success"
				:borderStyle="lineStyle">{{text}}</t-divider>
			<t-divider class="mb.30" :line="line" :dot="isdot" type="error"
				:borderStyle="lineStyle">{{text}}</t-divider>
			<t-divider class="mb.30" :line="line" :dot="isdot" type="primary"
				:borderStyle="lineStyle">{{text}}</t-divider>
			<t-divider class="mb.30" :line="line" :dot="isdot" type="warning"
				:borderStyle="lineStyle">{{text}}</t-divider>
		</t-col>
		<t-row class="ffww-tdr-tdb-mt.20-p.20">
			<t-button size='mini' class="mrb.30" type='p' @click="setText">设置文本</t-button>
			<t-button size='mini' type='p' class="mrb.30" @click="setBorder">设置线条样式</t-button>
			<t-button size='mini' type='p' class="mrb.30" @click="setBorder1">不显示线条</t-button>
			<t-button size='mini' type='p' class="mrb.30" @click="setDot">显示圆点</t-button>
		</t-row>
	</t-page>
</template>
<script setup>
	const text = ref('')
	const line = ref(true)
	const lineStyle = ref('solid')
	const isdot = ref(false)
	function setText() {
		text.value = text.value == '' ? '加载中' : ''
	}
	function setBorder() {
		lineStyle.value = lineStyle.value == 'solid' ? 'dashed' : 'solid'
	}
	function setBorder1() {
		line.value = line.value ? false : true
	}
	function setDot() {
		isdot.value = !isdot.value
	}
</script>

Props

名称描述类型默认值可选值
size分割线的大小String'small''large', 'medium'
line是否显示线条Booleantruefalse
borderClass边框的额外类名String''-
lineStyle线条的样式String'solid''dashed', 'dotted'
hairline是否使用细线Booleantruefalse
lineClass线条的额外类名String''-
dot是否显示圆点Booleanfalsetrue
dotClass圆点的额外类名String''-

Events

事件名描述回调参数版本
----