Skip to content

MarkedTh (MarkedTable子组件)

MarkedTable子组件

支持平台

安卓ios鸿蒙web微信小程序

示例代码

html
<template>
	<t-page main-class="p-30">
		<t-card title="MarkedTable 富文本表格" main-class="mb-30" sub-title="t-marked的子组件,也可以单独当成表格使用,使用方法类似html中的table使用方法"></t-card>
		<t-scroll direction="horizontal" main-class="mb-30">
			<t-marked-table align="center" main-class="tdr" :stripe="stripe" :border="true">
				<t-marked-tr>
					<t-marked-th>姓名</t-marked-th>
					<t-marked-th align="center">性别</t-marked-th>
					<t-marked-th align="right">年龄</t-marked-th>
					<t-marked-th width="260">时间</t-marked-th>
				</t-marked-tr>
				<t-scroll main-class="h-400px">
					<t-marked-tr v-for="(item, index) in huilvList" :key="index">
						<t-marked-td>{{ item.name?? '' }}</t-marked-td>
						<t-marked-td>{{ item.gender ?? '' }}</t-marked-td>
						<t-marked-td>{{ item.age ?? '' }}</t-marked-td>
						<t-marked-td>{{ item.updateTime ?? '' }}</t-marked-td>
					</t-marked-tr>
				</t-scroll>
			</t-marked-table>
		</t-scroll>
		<t-button @click="test" type="primary">test</t-button>
	</t-page>
</template>

<script setup>
	const stripe = ref<boolean>(true)
	const huilvList = ref<UTSJSONObject[]>([
		{
			name: '张三',
			gender: '男',
			age: 25,
			updateTime: '2023-01-01'
		},
		{
			name: '李四',
			gender: '女',
			age: 30,
			updateTime: '2023-01-02'
		},
		{
			name: '王五',
			gender: '男',
			age: 28,
			updateTime: '2023-01-03'
		},
		{
			name: '赵六',
			gender: '女',
			age: 22,
			updateTime: '2023-01-04'
		},
		{
			name: '孙七',
			gender: '男',
			age: 35,
			updateTime: '2023-01-05'
		},
		{
			name: '周八',
			gender: '女',
			age: 29,
			updateTime: '2023-01-06'
		}
	]);
	function test() {
		stripe.value = !stripe.value
	}
</script>

属性

名称类型默认值说明可选值
sizeStringmini组件尺寸large(大尺寸), medium(中尺寸), small(小尺寸), mini(迷你)
typeString""组件类型info(信息), primary(正常), error(错误), warning(警告), success(成功)
disabledBooleanfalse组件是否禁用false, true
stopBooleanfalse是否阻止事件冒泡(Tui统一写法处理事件冒泡)false, true
hoverBooleantrue是否有点击效果false, true
pathString""点击组件后跳转的页面路径,如果为空则响应点击事件,如果不为空则跳转页面不会响应单击事件。-
mainClassString""组件根节点的样式-
nativeClassString""组件根节点原生样式-
effectString"normal"组件显示主题normal(正常), dark(深色), light(浅色), plain(镂空)
alignStringleft对齐方式
widthString``列宽

插槽

名称返回值说明
default-