[Bug] 表头设置二级时,columns找不到类型
Open
Nobody has claimed this yet.
bug
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 486
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 16
Description
Version
1.20.0
Link to Minimal Reproduction
https://codesandbox.io/p/sandbox/vtable-list-table-forked-8dzz22?file=%2Fsrc%2Findex.ts%3A136%2C17
Steps to Reproduce
import { ColumnsDefine } from "@visactor/vtable";
const columnsList: ColumnsDefine = [
{
field: "id",
title: "ID",
width: 80,
sort: true,
},
{
field: "full name",
title: "Full name",
columns: [
{
field: "name",
title: "First Name\n(input editor)",
width: 120,
editor: "input-editor",
},
{
field: "lastName",
title: "Last Name\n(input editor)",
width: 100,
},
],
},
{
field: "sex",
title: "sex\n(list editor)",
width: 100,
}
}
Current Behavior
二级表头的columns类型无法推导出来(为undefined),貌似还有很多类似情况,是否是类型未定义完整
Expected Behavior
希望能够提供完整可使用的类型
Environment
- OS:
- Browser:
- Framework:
Any additional comments?
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the TypeScript reproduction in src/index.ts at the linked CodeSandbox location and inspect the exported ColumnsDefine type used by the nested columns property. Verify the type definitions for both header levels and confirm in the reproduction that nested columns receive usable inferred types rather than undefined.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100