From af13557ea02f5c742574e7e47a8a3f1e05311050 Mon Sep 17 00:00:00 2001 From: maxbad <26058031@qq.com> Date: Sat, 10 Jun 2023 19:40:20 +0800 Subject: [PATCH] =?UTF-8?q?BasicTable=E7=BB=84=E4=BB=B6=E4=B8=ADactionColu?= =?UTF-8?q?mn=E7=9A=84fixed=E5=B1=9E=E6=80=A7=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/Table/src/hooks/useColumns.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/web/src/components/Table/src/hooks/useColumns.ts b/web/src/components/Table/src/hooks/useColumns.ts index 20f364e..8ff93fa 100644 --- a/web/src/components/Table/src/hooks/useColumns.ts +++ b/web/src/components/Table/src/hooks/useColumns.ts @@ -92,10 +92,17 @@ export function useColumns(propsRef: ComputedRef) { function handleActionColumn(propsRef: ComputedRef, columns: BasicColumn[]) { const { actionColumn } = unref(propsRef); if (!actionColumn) return; - !columns.find((col) => col.key === 'action') && - columns.push({ - ...(actionColumn as any), - }); + if (!columns.find((col) => col.key === 'action')) { + if ((actionColumn as any).fixed && (actionColumn as any).fixed === 'left') { + columns.unshift({ + ...(actionColumn as any), + }); + } else { + columns.push({ + ...(actionColumn as any), + }); + } + } } //设置