✨(component): 新增 table 组件 columns 配置 totalRow 属性, 用于支持列统计
This commit is contained in:
@@ -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 完整表格
|
||||
:::
|
||||
|
||||
|
||||
Reference in New Issue
Block a user