Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

refactor(data-grid): drop unused gridRef/scrollbarGutter options from useDataGridColumnResize

t8y2e67e7730d101
diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue
index ee20e269b9..99f296a784 100644
--- a/apps/desktop/src/components/grid/DataGrid.vue
+++ b/apps/desktop/src/components/grid/DataGrid.vue
@@ -2650,8 +2650,6 @@ const { initColumnWidths, onResizeStart, autoFitColumn, renderedColumnWidths, to
columns: visibleColumns,
sourceRows: computed(() => props.result.rows),
columnIndexes: visibleColumnIndexes,
- gridRef,
- scrollbarGutter: gridScrollbarGutter,
});
const gridStyle = computed(() => ({
...columnVars.value,
diff --git a/apps/desktop/src/composables/__tests__/useDataGridColumnResize.spec.ts b/apps/desktop/src/composables/__tests__/useDataGridColumnResize.spec.ts
index 0556fd64fa..c3f8fa3e09 100644
--- a/apps/desktop/src/composables/__tests__/useDataGridColumnResize.spec.ts
+++ b/apps/desktop/src/composables/__tests__/useDataGridColumnResize.spec.ts
@@ -1,4 +1,4 @@
-import { computed, ref } from "vue";
+import { computed } from "vue";
import { describe, expect, it } from "vitest";
import { DATA_GRID_COL_AUTO_FIT_MAX_WIDTH, DATA_GRID_COL_MAX_WIDTH, DATA_GRID_COL_MIN_WIDTH } from "@/lib/dataGrid/dataGridColumnWidth";
import { DATA_GRID_ROW_NUM_WIDTH, resizeDataGridColumnWidth, useDataGridColumnResize } from "@/composables/useDataGridColumnResize";
@@ -8,8 +8,6 @@ function createResizeState(options: { columns: string[]; rows: Array<Array<strin
columns: computed(() => options.columns),
sourceRows: computed(() => options.rows),
columnIndexes: computed(() => options.columnIndexes ?? options.columns.map((_, index) => index)),
- gridRef: ref<HTMLDivElement>(),
- scrollbarGutter: ref(0),
});
}
diff --git a/apps/desktop/src/composables/useDataGridColumnResize.ts b/apps/desktop/src/composables/useDataGridColumnResize.ts
index 7b5b688a64..03546c078e 100644
--- a/apps/desktop/src/composables/useDataGridColumnResize.ts
+++ b/apps/desktop/src/composables/useDataGridColumnResize.ts
@@ -1,4 +1,4 @@
-import { ref, computed, watch, type ComputedRef, type Ref } from "vue";
+import { ref, computed, watch, type ComputedRef } from "vue";
import { calculateDataGridColumnWidth, DATA_GRID_AUTO_FIT_VALUE_TEXT_LIMIT, DATA_GRID_COL_AUTO_FIT_MAX_WIDTH, DATA_GRID_COL_MIN_WIDTH, DATA_GRID_SAMPLE_ROWS } from "@/lib/dataGrid/dataGridColumnWidth";
type CellValue = string | number | boolean | null;
@@ -13,8 +13,6 @@ export interface UseDataGridColumnResizeOptions {
columns: ComputedRef<string[]>;
sourceRows: ComputedRef<CellValue[][]>;
columnIndexes: ComputedRef<number[]>;
- gridRef: Ref<HTMLDivElement | undefined>;
- scrollbarGutter?: Ref<number>;
}
export function useDataGridColumnResize(options: UseDataGridColumnResizeOptions) {