VisActor / VisActor/VTable

[Bug] 表头设置二级时,columns找不到类型

Open
#4,533 3 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.