Skip to content

Commit 8a41cf1

Browse files
authored
fix: Fix log list scroll-x (#273)
1 parent a6cf825 commit 8a41cf1

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

web/src/components/logs/LogTable.vue

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,11 @@ const createColumns = () => {
391391
// Computed columns that react to visibility changes
392392
const columns = computed(() => createColumns());
393393
394+
const scrollX = computed(() => {
395+
const visibleColumns = createColumns();
396+
return visibleColumns.reduce((total, col) => total + (col.width || 100), 0);
397+
});
398+
394399
// Lifecycle and Watchers
395400
onMounted(() => {
396401
loadColumnPreferences();
@@ -640,7 +645,14 @@ const deselectAllColumns = () => {
640645
<!-- 表格 -->
641646
<div class="table-container">
642647
<n-spin :show="loading">
643-
<n-data-table :columns="columns" :data="logs" :bordered="false" remote size="small" />
648+
<n-data-table
649+
:columns="columns"
650+
:data="logs"
651+
:bordered="false"
652+
remote
653+
size="small"
654+
:scroll-x="scrollX"
655+
/>
644656
</n-spin>
645657
</div>
646658

0 commit comments

Comments
 (0)