(all): update

This commit is contained in:
就眠儀式 2022-05-29 15:07:19 +08:00
parent e5fd1c6995
commit dfe2d372b3
3 changed files with 15 additions and 7 deletions

View File

@ -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>

View File

@ -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;
}

View File

@ -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"