diff --git a/src/component/table/index.vue b/src/component/table/index.vue index 3e9171a6..20976db8 100644 --- a/src/component/table/index.vue +++ b/src/component/table/index.vue @@ -12,6 +12,7 @@ import { defineProps, withDefaults, defineEmits, + onMounted, } from "vue"; import { Recordable } from "../../types"; import { guid } from "../../utils/guidUtil"; @@ -109,6 +110,16 @@ const print = function () { window.location.reload(); document.body.innerHTML = oldContent; }; + +let tableHeader = ref(null); +let tableBody = ref(null); + +onMounted(() => { + tableBody.value?.addEventListener('scroll', () => { + tableHeader.value!.scrollLeft = tableBody.value?.scrollLeft || 0; + }) +}) +