✨(all): update
This commit is contained in:
parent
e5fd1c6995
commit
dfe2d372b3
@ -9,6 +9,7 @@ import { computed, ref, useSlots, WritableComputedRef } from "vue";
|
||||
import { Recordable } from "../../types";
|
||||
|
||||
export interface LayTableRowProps {
|
||||
expandSpace: boolean;
|
||||
selectedKeys: Recordable[];
|
||||
tableColumnKeys: Recordable[];
|
||||
columns: Recordable[];
|
||||
@ -26,7 +27,7 @@ const emit = defineEmits([
|
||||
]);
|
||||
|
||||
const props = withDefaults(defineProps<LayTableRowProps>(), {
|
||||
checkbox: false
|
||||
checkbox: false,
|
||||
});
|
||||
|
||||
const tableSelectedKeys: WritableComputedRef<Recordable[]> = computed({
|
||||
@ -166,6 +167,7 @@ const handleExpand = () => {
|
||||
:columns="columns"
|
||||
:checkbox="checkbox"
|
||||
:tableColumnKeys="tableColumnKeys"
|
||||
:expandSpace="expandSpace"
|
||||
@row="rowClick"
|
||||
@row-double="rowDoubleClick"
|
||||
@contextmenu="contextmenu"
|
||||
@ -180,4 +182,4 @@ const handleExpand = () => {
|
||||
</table-row>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
@ -362,11 +362,7 @@
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.layui-table-cell-expand-icon-none {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.layui-table-cell-expand-icon-hidden {
|
||||
.layui-table-cell-expand-icon-spaced {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
|
@ -207,6 +207,15 @@ props.columns.map((value: any) => {
|
||||
slotsData.value.push(value.customSlot);
|
||||
}
|
||||
});
|
||||
|
||||
// is tree
|
||||
const childrenExpandSpace = ref(false);
|
||||
|
||||
props.dataSource.map((value: any) => {
|
||||
if(value.children) {
|
||||
childrenExpandSpace.value = true;
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -324,6 +333,7 @@ props.columns.map((value: any) => {
|
||||
:columns="columns"
|
||||
:checkbox="checkbox"
|
||||
:tableColumnKeys="tableColumnKeys"
|
||||
:expandSpace="childrenExpandSpace"
|
||||
@row="rowClick"
|
||||
@row-double="rowDoubleClick"
|
||||
@contextmenu="contextmenu"
|
||||
|
Loading…
Reference in New Issue
Block a user