Skip to content

Commit d4060a5

Browse files
author
tangwenhui1
committed
feat: opt code
1 parent e70d3c3 commit d4060a5

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

examples/simple.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { CascaderProps } from '../src';
44
import Cascader from '../src';
55
import type { Option2 } from './utils';
66

7-
const addressOptions: CascaderProps["options"] = [
7+
const addressOptions = [
88
{
99
label: '福建',
1010
value: 'fj',

examples/utils.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ export interface Option {
33
name?: string;
44
nodes?: Option[];
55
disabled?: boolean;
6-
[key: string]: any;
76
}
87

98
export interface Option2 {
@@ -15,5 +14,4 @@ export interface Option2 {
1514
isLeaf?: boolean;
1615
loading?: boolean;
1716
children?: Option2[];
18-
[key: string]: any;
1917
}

src/Cascader.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,15 @@ import {
3030
import { formatStrategyValues, toPathOptions } from './utils/treeUtil';
3131
import { warningNullOptions } from './utils/warningPropsUtil';
3232

33-
34-
export type HTMLAriaDataAttributes = React.AriaAttributes & Record<`data-${string}`, unknown> & Pick<React.HTMLAttributes<HTMLDivElement>, 'role'>;
35-
3633
export interface BaseOptionType {
3734
disabled?: boolean;
3835
disableCheckbox?: boolean;
3936
label?: React.ReactNode;
4037
value?: string | number | null;
4138
children?: DefaultOptionType[];
42-
[key: string]: any;
4339
}
4440

45-
export type DefaultOptionType = BaseOptionType & HTMLAriaDataAttributes & Record<string, any>;
41+
export type DefaultOptionType = BaseOptionType & Record<string, any>;
4642

4743
export interface ShowSearchType<
4844
OptionType extends DefaultOptionType = DefaultOptionType,

0 commit comments

Comments
 (0)