File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -391,6 +391,11 @@ const createColumns = () => {
391391// Computed columns that react to visibility changes
392392const 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
395400onMounted (() => {
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
You can’t perform that action at this time.
0 commit comments