ElemeFE / ElemeFE/element-react

"defaultExpandAll" property was not defined in typing/index.d.ts

Open
#1,021 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.8k
Forks
435
PR merge metrics
No merged PRs in 30d

Description

### Description

"defaultExpandAll" property was not defined in typing/index.d.ts

### Reproduce Steps

1. Write down ``
2. Compile, tsc will have compiled error

### Error Trace (if possible)

```
No overload matches this call.
Overload 1 of 2, '(props: Readonly): Table', gave the following error.
Type '{ style: { width: string; }; columns: ({ type: string; expandPannel: (data: any) => Element; label?: undefined; prop?: undefined; width?: undefined; } | { label: string; prop: string; width: number; type?: undefined; expandPannel?: undefined; } | { ...; })[]; data: { ...; }[]; border: false; defaultExpandAll: boolea...' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly & Readonly<{ children?: ReactNode; }>'.
Property 'defaultExpandAll' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly & Readonly<{ children?: ReactNode; }>'.
Overload 2 of 2, '(props: TableProps, context?: any): Table', gave the following error.
Type '{ style: { width: string; }; columns: ({ type: string; expandPannel: (data: any) => Element; label?: undefined; prop?: undefined; width?: undefined; } | { label: string; prop: string; width: number; type?: undefined; expandPannel?: undefined; } | { ...; })[]; data: { ...; }[]; border: false; defaultExpandAll: boolea...' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly & Readonly<{ children?: ReactNode; }>'.
Property 'defaultExpandAll' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly & Readonly<{ children?: ReactNode; }>'. TS2769
```

### Solution
Add defaultExpandAll to the interface TableProps.
```
interface TableProps extends ElementReactLibs.ComponentProps<{}> {
columns?: TableColumn[]
data?: Object[]
height?: number
stripe?: boolean
border?: boolean
fit?: boolean
rowClassName?(row?, index?): void
style?: Object
highlightCurrentRow?: boolean
// defaultExpandAll?: boolean
onCurrentChange?(): void
onSelectAll?(): void
onSelectChange?(): void
}
```

### Additional Information

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.