diff --git a/package/component/src/component/table/index.vue b/package/component/src/component/table/index.vue index b284a838..74cff02a 100644 --- a/package/component/src/component/table/index.vue +++ b/package/component/src/component/table/index.vue @@ -176,7 +176,7 @@ const exportData = () => { throw new Error("exception"); } }); - } catch (e) { } + } catch (e) {} }); tableDataSource.value.forEach((item) => { let obj: any = []; @@ -268,32 +268,34 @@ onMounted(() => { }); window.onresize = () => { getFixedColumn(); - } + }; }); - const getFixedColumn = () => { tableHeader.value!.scrollLeft = tableBody.value?.scrollLeft || 0; // @ts-ignore - if( tableBody.value?.scrollWidth > tableBody.value?.clientWidth) { - if (tableBody.value?.scrollLeft == 0) { - hasl.value = false; - hasr.value = true; - } else { - // @ts-ignore - if (tableBody.value?.scrollLeft + tableBody.value?.offsetWidth > tableBody.value?.scrollWidth) { - hasl.value = true; - hasr.value = false; - } else { - hasl.value = true; + if (tableBody.value?.scrollWidth > tableBody.value?.clientWidth) { + if (tableBody.value?.scrollLeft == 0) { + hasl.value = false; hasr.value = true; + } else { + // @ts-ignore + if ( + tableBody.value?.scrollLeft + tableBody.value?.offsetWidth > + tableBody.value?.scrollWidth + ) { + hasl.value = true; + hasr.value = false; + } else { + hasl.value = true; + hasr.value = true; + } } - } } else { hasl.value = false; hasr.value = false; } -} +}; const slotsData = ref([]); @@ -398,15 +400,31 @@ const renderTotalRowCell = (column: any) => { -
+
-
+
@@ -414,40 +432,59 @@ const renderTotalRowCell = (column: any) => {
-
+
-