Skip to content

Commit b92939d

Browse files
committed
chore: update version to 0.3.26 and add key property to field options
1 parent 8ec68c2 commit b92939d

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

packages/tushan/client/components/fields/factory.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export function createFieldFactory<CustomOptions extends {} = {}>(
6262
return {
6363
hidden: options?.list?.hidden ?? false,
6464
columnProps: {
65+
key: options?.key,
6566
dataIndex: source,
6667
sorter: options?.list?.sort ?? false,
6768
sortDirections: ['ascend', 'descend'],
@@ -89,6 +90,7 @@ export function createFieldFactory<CustomOptions extends {} = {}>(
8990
}
9091

9192
return {
93+
key: options?.key,
9294
source,
9395
title: options?.label ?? createElement(FieldTitle, { source }),
9496
hidden: editOptions.hidden ?? false,
@@ -104,6 +106,7 @@ export function createFieldFactory<CustomOptions extends {} = {}>(
104106
} as EditFieldItem;
105107
} else if (viewType === 'detail') {
106108
return {
109+
key: options?.key,
107110
source,
108111
title: options?.label ?? createElement(FieldTitle, { source }),
109112
hidden: options?.detail?.hidden ?? false,

packages/tushan/client/components/fields/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ export interface BasicFieldEditOptions {
1212
}
1313

1414
export interface BasicFieldOptions {
15+
key?: string;
16+
1517
label?: string;
1618

1719
/**

packages/tushan/client/components/layout/Breadcrumb.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const TushanBreadcrumb: React.FC = React.memo(() => {
3535

3636
return (
3737
<Breadcrumb style={{ marginBottom: 16 }}>
38-
<Breadcrumb.Item>
38+
<Breadcrumb.Item key="dashboard">
3939
{dashboard !== false ? (
4040
<NavLink to="/dashboard" key="home-dashboard">
4141
<IconHome className="mr-2" style={{ marginRight: 2 }} />
@@ -51,7 +51,7 @@ export const TushanBreadcrumb: React.FC = React.memo(() => {
5151
)}
5252
</Breadcrumb.Item>
5353

54-
{title && <Breadcrumb.Item>{title}</Breadcrumb.Item>}
54+
{title && <Breadcrumb.Item key="title">{title}</Breadcrumb.Item>}
5555
</Breadcrumb>
5656
);
5757
});

packages/tushan/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tushan",
3-
"version": "0.3.24",
3+
"version": "0.3.26",
44
"description": "",
55
"main": "./index.ts",
66
"scripts": {

0 commit comments

Comments
 (0)