mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-02-04 13:42:27 +08:00
Merge pull request #24 from CasbaL/fix/table-setting-bug
fix(Table): 基本表格设置列固定时,重复添加action列导致的样式错乱问题
This commit is contained in:
@@ -94,7 +94,7 @@ export function useColumns(propsRef: ComputedRef<BasicTableProps>) {
|
||||
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<BasicTableProps>) {
|
||||
}
|
||||
|
||||
//获取
|
||||
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 };
|
||||
|
||||
@@ -231,7 +231,7 @@
|
||||
name: 'xiaoMa',
|
||||
},
|
||||
actionColumn: {
|
||||
width: 140,
|
||||
width: 220,
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
fixed: 'right',
|
||||
|
||||
Reference in New Issue
Block a user