mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-03-01 00:23:11 +08:00
fix: 基本表格设置列固定时,重复添加action列导致的样式错乱问题
This commit is contained in:
@@ -94,7 +94,7 @@ export function useColumns(propsRef: ComputedRef<BasicTableProps>) {
|
|||||||
const { actionColumn } = unref(propsRef);
|
const { actionColumn } = unref(propsRef);
|
||||||
if (!actionColumn) return;
|
if (!actionColumn) return;
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
columns.push({
|
!columns.find((col) => col.key === 'action') && columns.push({
|
||||||
...actionColumn,
|
...actionColumn,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -129,7 +129,7 @@ export function useColumns(propsRef: ComputedRef<BasicTableProps>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//获取
|
//获取
|
||||||
function getColumns() {
|
function getColumns(): BasicColumn[] {
|
||||||
const columns = toRaw(unref(getColumnsRef));
|
const columns = toRaw(unref(getColumnsRef));
|
||||||
return columns.map((item) => {
|
return columns.map((item) => {
|
||||||
return { ...item, title: item.title, key: item.key, fixed: item.fixed || undefined };
|
return { ...item, title: item.title, key: item.key, fixed: item.fixed || undefined };
|
||||||
|
|||||||
@@ -231,7 +231,7 @@
|
|||||||
name: 'xiaoMa',
|
name: 'xiaoMa',
|
||||||
},
|
},
|
||||||
actionColumn: {
|
actionColumn: {
|
||||||
width: 140,
|
width: 220,
|
||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
|
|||||||
Reference in New Issue
Block a user