|
|
@ -29,6 +29,10 @@ export default defineComponent({ |
|
|
|
}, |
|
|
|
// 展开行 |
|
|
|
expand: propTypes.bool.def(false), |
|
|
|
expandFixed: { |
|
|
|
type: Boolean || String, |
|
|
|
default: 'left' |
|
|
|
}, |
|
|
|
// 是否展示分页 |
|
|
|
pagination: { |
|
|
|
type: Object as PropType<Pagination>, |
|
|
@ -190,10 +194,10 @@ export default defineComponent({ |
|
|
|
} |
|
|
|
|
|
|
|
const renderTableExpand = () => { |
|
|
|
const { align, headerAlign, expand,border } = unref(getProps) |
|
|
|
const { align, headerAlign, expand,border,expandFixed } = unref(getProps) |
|
|
|
// 渲染展开行 |
|
|
|
return expand ? ( |
|
|
|
<ElTableColumn type="expand" align={align} headerAlign={headerAlign} border={border}> |
|
|
|
<ElTableColumn fixed={expandFixed} d type="expand" align={align} headerAlign={headerAlign} border={border}> |
|
|
|
{{ |
|
|
|
// @ts-ignore |
|
|
|
default: (data: TableSlotDefault) => getSlot(slots, 'expand', data) |
|
|
@ -295,14 +299,16 @@ export default defineComponent({ |
|
|
|
|
|
|
|
return () => ( |
|
|
|
<div v-loading={unref(getProps).loading}> |
|
|
|
<ElTable |
|
|
|
<ElTable default-expand-all={true} |
|
|
|
// @ts-ignore |
|
|
|
ref={elTableRef} |
|
|
|
data={unref(getProps).data} |
|
|
|
header-cell-class-name="tableHeader" |
|
|
|
row-class-name="tableRow" |
|
|
|
cell-class-name="tableRow" |
|
|
|
onSelection-change={selectionChange} |
|
|
|
onSort-change={sortChange} |
|
|
|
{...unref(getBindValue)} |
|
|
|
stripe |
|
|
|
{...unref(getBindValue)} |
|
|
|
> |
|
|
|
{{ |
|
|
|
default: () => rnderTableColumn(), |
|
|
@ -326,6 +332,17 @@ export default defineComponent({ |
|
|
|
} |
|
|
|
}) |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
|
.expandTable .el-table .tableHeader{ |
|
|
|
--el-table-header-bg-color: #f5f5f5; |
|
|
|
} |
|
|
|
.expandTable .el-table .tableRow{ |
|
|
|
--el-table-tr-bg-color: #f5f5f5; |
|
|
|
--el-bg-color:#f5f5f5; |
|
|
|
} |
|
|
|
|
|
|
|
</style> |
|
|
|
<style lang="scss" scoped> |
|
|
|
:deep(.el-button.is-text) { |
|
|
|
padding: 8px 4px; |
|
|
@ -336,4 +353,5 @@ export default defineComponent({ |
|
|
|
padding: 8px 4px; |
|
|
|
margin-left: 0; |
|
|
|
} |
|
|
|
|
|
|
|
</style> |
|
|
|