Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task
huangmingfu opened this issue May 20, 2025 · 0 comments
Open
1 task

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

huangmingfu opened this issue May 20, 2025 · 0 comments

Comments

@huangmingfu
Copy link

  • 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 属性

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant