Skip to content

a-tree 组件的 TreeProps['treeData'] 类型报错 #8186

Open
@huangmingfu

Description

@huangmingfu
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.2.6

Environment

mozilla/5.0 (windows nt 10.0; win64; x64) applewebkit/537.36 (khtml, like gecko) chrome/128.0.0.0 safari/537.36

Reproduction link

https://www.antdv.com/components/tree-cn#api

Steps to reproduce

它必须需要一个 key 字段,复现demo

Image

但是我用 fieldNames 指定替换了它的 keyid

const fieldNames: TreeProps['fieldNames'] = {
children: 'child',
title: 'name',
key:'id'
};

Image

What is expected?

不报ts类型错误

What is actually happening?

报数据类型不符合TreeProps['treeData'] 错误,缺少 key 属性

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions