Skip to content
On this page

组件库文档 tmui.design

描述 Descriptions

主要用于详细字段的陈述,可用于详情,列表一些描述性展示


🌶️ 描述 Descriptions 示例

查看模拟效果
示例模板
vue
<template>
    <tm-app>
        <tm-sheet :padding="[0]" :margin="[32,16]">
            <tm-descriptions :data="list" ></tm-descriptions>
        </tm-sheet>
        <tm-sheet :margin="[32,0]" :padding="[0]">
            <tm-descriptions :label-width="100" :width="686" :column="3" transprent :round="3" text title="展示3列属性">
                <tm-descriptions-item  :font-size="24" v-for="(item,index) in list2" :key="index" :label="item.label" :value="item.value"></tm-descriptions-item>
                <tm-descriptions-item :font-size="24" color="red" label="工具" value="vscode">
                    <tm-sheet color="red" text :border="1" :margin="[6,0]" :padding="[4]" :round="2">
                        <tm-text :font-size="24" label="vscode"></tm-text>
                    </tm-sheet>
                </tm-descriptions-item>
            </tm-descriptions>
            
        </tm-sheet>

        
    </tm-app>
</template>
<script lang="ts" setup>
import { ref } from "vue"
import { onShow, onLoad } from "@dcloudio/uni-app";
import tmApp from "@/tmui/components/tm-app/tm-app.vue"
import tmSheet from "@/tmui/components/tm-sheet/tm-sheet.vue"
import tmText from "@/tmui/components/tm-text/tm-text.vue"
import tmDescriptions from "@/tmui/components/tm-descriptions/tm-descriptions.vue"
import tmDescriptionsItem from "@/tmui/components/tm-descriptions-item/tm-descriptions-item.vue"
import tmDivider from "@/tmui/components/tm-divider/tm-divider.vue"

const list = [
    {label:'同步时间',value:'2022/5/12'},
    {label:'同步时间',value:'2022/5/12'},
    {label:'同步时间',value:'2022/5/12'},
    {label:'同步时间',value:'2022/5/12'},
]
const list2 = [
    {label:'客户',value:'同名自定义'},
    {label:'金额',value:'¥256'},
    {label:'状态',value:'正常'},
    {label:'禁用',value:''},
]


</script>

🌶️ 兼容性

APP-VUEAPP-NVUE小程序WEB/H5VUE3/TS
✔️✔️✔️✔️✔️

🌱 参数

本组件含有公共属性 公共属性

参数名类型默认值描述
shadow[Number,String]0投影,0-25
round[Number,String]0圆角0-25,单位rpx
border[Number]0边框宽度
marginArray()=>[0,0]外间距[x,y]x=左右,y=上下
paddingArray()=>[16,16]内间距[x,y]x=左右,y=上下
transprent[Boolean,String]false是否透明
colorString'white'背景颜色
column[Number,String]2需要展示的列数
dataArray[]数据。 这个是快捷方法,如果提供了,那么插槽中不需要填写tm-descriptions-item
keyMap[Object]{key:'label',value:'value'}
titleString""头部左边的标题
labelWidth[String,Number]""定标签为等宽

🌹 事件

🌽 slot插槽

属性名称类型数据说明
title""自定义头部的内容

🥗 ref方法

🌱 tm-descriptions-item参数

本组件含有公共属性 公共属性

参数名类型默认值描述
labelString''标签文本
valueString''标签值
colorString''标签文字颜色
fontSizeNumber23标签文字大小

贡献者

Mr.童