element-plus / element-plus

🎉 A Vue.js 3 UI Library made by Element team
https://element-plus.org
MIT License
24.49k stars 16.52k forks source link

[Feature Request] [tree] node-key field support method type #10266

Open zhiyuanzmj opened 2 years ago

zhiyuanzmj commented 2 years ago

Existing Component

Yes

Component Name

el-tree

Description

I want node-key to provide the method type as well as props.label

Living examples

https://element-plus.run

chenxch commented 2 years ago

Why not deal with it in advance?

zhiyuanzmj commented 2 years ago

Formatting a tree data structure is cumbersome. (´・ω・`)

chenxch commented 2 years ago

I think the problem that can be solved with data is still solved with data, not increasing the complexity of components. This is just my personal opinion. /cc @element-plus/backers

Simon-He95 commented 2 years ago

I think the problem that can be solved with data is still solved with data, not increasing the complexity of components. This is just my personal opinion. /cc @element-plus/backers

I think so.

tolking commented 2 years ago

IMO, It may be possible to solve this problem by get functions from lodash-unified (eg. valueKey in SelectV2)