add spanMethod to base-table

This commit is contained in:
2022-08-23 11:11:51 +08:00
parent 4297798d44
commit 8f124e06b1
2 changed files with 220 additions and 201 deletions

View File

@@ -1,6 +1,14 @@
<template>
<div class="base-table">
<el-table :data="data" style="width: 100%" fit border :header-cell-style="{ background: '#FAFAFA', color: '#606266', height: '40px' }" :max-height="maxHeight">
<el-table
:data="data"
style="width: 100%"
fit
border
:header-cell-style="{ background: '#FAFAFA', color: '#606266', height: '40px' }"
:max-height="maxHeight"
:span-method="spanMethod || null"
>
<!-- 表格头定义 -->
<template v-for="(head, idx) in tableHeadConfigs">
<!-- 带type的表头 -->
@@ -61,6 +69,13 @@ export default {
maxHeight: {
type: Number,
default: 500
},
spanMethod: {
type: Function,
default: () => {
() => [0, 0]
},
required: false
}
},
filters: {