mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [table] fix merge cell cannot show side shadow (#10095)
This commit is contained in:
@@ -116,7 +116,7 @@ function useRender<T>(props: Partial<TableBodyProps<T>>) {
|
||||
'td',
|
||||
{
|
||||
style: getCellStyle($index, cellIndex, row, column),
|
||||
class: getCellClass($index, cellIndex, row, column),
|
||||
class: getCellClass($index, cellIndex, row, column, colspan - 1),
|
||||
key: `${patchKey}${baseKey}`,
|
||||
rowspan,
|
||||
colspan,
|
||||
|
||||
@@ -79,11 +79,19 @@ function useStyles<T>(props: Partial<TableBodyProps<T>>) {
|
||||
rowIndex: number,
|
||||
columnIndex: number,
|
||||
row: T,
|
||||
column: TableColumnCtx<T>
|
||||
column: TableColumnCtx<T>,
|
||||
offset: number
|
||||
) => {
|
||||
const fixedClasses = column.isSubColumn
|
||||
? []
|
||||
: getFixedColumnsClass(ns.b(), columnIndex, props?.fixed, props.store)
|
||||
: getFixedColumnsClass(
|
||||
ns.b(),
|
||||
columnIndex,
|
||||
props?.fixed,
|
||||
props.store,
|
||||
undefined,
|
||||
offset
|
||||
)
|
||||
const classes = [column.id, column.align, column.className, ...fixedClasses]
|
||||
const cellClassName = parent?.props.cellClassName
|
||||
if (typeof cellClassName === 'string') {
|
||||
|
||||
@@ -440,18 +440,22 @@ export const getFixedColumnsClass = <T>(
|
||||
index: number,
|
||||
fixed: string | boolean,
|
||||
store: any,
|
||||
realColumns?: TableColumnCtx<T>[]
|
||||
realColumns?: TableColumnCtx<T>[],
|
||||
offset = 0
|
||||
) => {
|
||||
const classes: string[] = []
|
||||
const { direction, start } = isFixedColumn(index, fixed, store, realColumns)
|
||||
if (direction) {
|
||||
const isLeft = direction === 'left'
|
||||
classes.push(`${namespace}-fixed-column--${direction}`)
|
||||
if (isLeft && start === store.states.fixedLeafColumnsLength.value - 1) {
|
||||
if (
|
||||
isLeft &&
|
||||
start + offset === store.states.fixedLeafColumnsLength.value - 1
|
||||
) {
|
||||
classes.push('is-last-column')
|
||||
} else if (
|
||||
!isLeft &&
|
||||
start ===
|
||||
start - offset ===
|
||||
store.states.columns.value.length -
|
||||
store.states.rightFixedLeafColumnsLength.value
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user