(component): 新增 table 组件 columns 配置 totalRow 属性, 用于支持列统计

This commit is contained in:
就眠儀式
2022-07-19 05:01:43 +08:00
parent 2a80deb010
commit 876947c79e
6 changed files with 121 additions and 20 deletions

View File

@@ -912,6 +912,65 @@ export default {
:::
::: title 合并列值
:::
::: demo 通过 `columns` 配置 `type:'number'` 开启序号列。
<template>
<lay-table :columns="columns26" :dataSource="dataSource26"></lay-table>
</template>
<script>
import { ref } from 'vue'
export default {
setup() {
const columns26 = [
{
title:"账户",
width:"200px",
key:"username"
},{
title:"密码",
width: "300px",
key:"password"
},{
title:"性别",
key:"sex",
totalRow:"合并:"
},{
title:"年龄",
width: "300px",
key:"age",
totalRow: true
},{
title:"备注",
width: "180px",
key:"remark",
ellipsisTooltip: true
}
]
const dataSource26 = [
{username:"root", password:"root",sex:"男", age:"18", remark: 'layui - vue谐音类 UI) '},
{username:"root", password:"root",sex:"男", age:"18", remark: 'layui - vue谐音类 UI) '},
{username:"woow", password:"woow",sex:"男", age:"20", remark: 'layui - vue谐音类 UI) '},
{username:"woow", password:"woow",sex:"男", age:"20", remark: 'layui - vue谐音类 UI) '},
{username:"woow", password:"woow",sex:"男", age:"20", remark: 'layui - vue谐音类 UI) '}
]
return {
columns26,
dataSource26,
}
}
}
</script>
:::
::: title 完整表格
:::