diff --git a/package/component/src/component/table/TableRow.vue b/package/component/src/component/table/TableRow.vue index 9cc74fe5..50ecdfe0 100644 --- a/package/component/src/component/table/TableRow.vue +++ b/package/component/src/component/table/TableRow.vue @@ -20,7 +20,7 @@ export interface LayTableRowProps { expandSpace: boolean; expandIndex: number; selectedKeys: Recordable[]; - selectedKey: any; + selectedKey: string; tableColumnKeys: Recordable[]; childrenColumnName?: string; columns: Recordable[]; @@ -73,7 +73,7 @@ const tableSelectedKeys: WritableComputedRef = computed({ }, }); -const tableSelectedKey: WritableComputedRef = computed({ +const tableSelectedKey: WritableComputedRef = computed({ get() { return props.selectedKey; }, diff --git a/package/component/src/component/table/index.vue b/package/component/src/component/table/index.vue index 4bdd676f..231a5a33 100644 --- a/package/component/src/component/table/index.vue +++ b/package/component/src/component/table/index.vue @@ -34,7 +34,7 @@ export interface LayTableProps { columns: Recordable[]; dataSource: Recordable[]; defaultToolbar?: boolean; - selectedKey?: any; + selectedKey?: string; selectedKeys?: Recordable[]; indentSize?: number; childrenColumnName?: string; @@ -58,6 +58,7 @@ const props = withDefaults(defineProps(), { childrenColumnName: "children", dataSource: () => [], selectedKeys: () => [], + selectedKey: '', maxHeight: "auto", even: false, rowClassName: "", @@ -117,7 +118,7 @@ watch( { deep: true } ); -const tableSelectedKey: WritableComputedRef = computed({ +const tableSelectedKey: WritableComputedRef = computed({ get() { return props.selectedKey; }, @@ -318,10 +319,10 @@ const getFixedColumn = () => { hasr.value = true; } else { // @ts-ignore - if ( - tableBody.value?.scrollLeft + tableBody.value?.offsetWidth + 2 > - tableBody.value?.scrollWidth - ) { + const t = tableBody.value?.scrollLeft + tableBody.value?.offsetWidth + 2; + const s = tableBody.value?.scrollWidth; + // @ts-ignore + if (t > s) { hasl.value = true; hasr.value = false; } else {