diff --git a/package/component/src/component/table/index.less b/package/component/src/component/table/index.less index 0ce0ecc8..a797d21a 100644 --- a/package/component/src/component/table/index.less +++ b/package/component/src/component/table/index.less @@ -27,7 +27,7 @@ .layui-table-tool, .layui-table-total, .layui-table-total tr, -.layui-table[lay-even] tr:nth-child(even) { +.layui-table.layui-table-even tr:nth-child(even) { background-color: var(--global-neutral-color-1); } diff --git a/package/component/src/component/table/index.vue b/package/component/src/component/table/index.vue index 7bbe3a3f..eaf3672d 100644 --- a/package/component/src/component/table/index.vue +++ b/package/component/src/component/table/index.vue @@ -29,6 +29,7 @@ export interface LayTableProps { childrenColumnName?: string; height?: number; maxHeight?: string; + even?: boolean; } const props = withDefaults(defineProps(), { @@ -39,6 +40,7 @@ const props = withDefaults(defineProps(), { dataSource: () => [], selectedKeys: () => [], maxHeight: "auto", + even: false, }); const tableId = uuidv4(); @@ -364,7 +366,7 @@ props.dataSource.map((value: any) => { :style="{ height: height, maxHeight: maxHeight }" ref="tableBody" > - +