diff --git a/src/components/Table/src/hooks/useColumns.ts b/src/components/Table/src/hooks/useColumns.ts index 42cb8ae..fe02104 100644 --- a/src/components/Table/src/hooks/useColumns.ts +++ b/src/components/Table/src/hooks/useColumns.ts @@ -94,7 +94,7 @@ export function useColumns(propsRef: ComputedRef) { const { actionColumn } = unref(propsRef); if (!actionColumn) return; // @ts-ignore - columns.push({ + !columns.find((col) => col.key === 'action') && columns.push({ ...actionColumn, }); } @@ -129,7 +129,7 @@ export function useColumns(propsRef: ComputedRef) { } //获取 - function getColumns() { + function getColumns(): BasicColumn[] { const columns = toRaw(unref(getColumnsRef)); return columns.map((item) => { return { ...item, title: item.title, key: item.key, fixed: item.fixed || undefined }; diff --git a/src/views/list/basicList/index.vue b/src/views/list/basicList/index.vue index e707303..1236f07 100644 --- a/src/views/list/basicList/index.vue +++ b/src/views/list/basicList/index.vue @@ -231,7 +231,7 @@ name: 'xiaoMa', }, actionColumn: { - width: 140, + width: 220, title: '操作', key: 'action', fixed: 'right',