Skip to content
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

tree node中的attrs会透传作为attribute #3421

Open
1 task
li1615882553 opened this issue Jan 14, 2025 · 0 comments
Open
1 task

tree node中的attrs会透传作为attribute #3421

li1615882553 opened this issue Jan 14, 2025 · 0 comments

Comments

@li1615882553
Copy link
Contributor

基本信息

复现步骤

tree组件中的数据中除了已定义的props,其余参数都会透传到node组件,当做节点dom的一个attribute;
这样有几个问题:

  1. 如果字段数据量很大,那么dom上的attribute就会变得很多,会影响性能
  2. 有些字段会命中vue的关键字,比如”className“,”className“会替换节点的class,如复现链接所示

我认为节点上有data-key就可以反查到真实数据,没有必要将所有数据都透传到node节点上。
所以请问这里把attrs透传作为attribute有什么好处或者是特意这样处理的吗?

image

@li1615882553 li1615882553 changed the title tree中node中的attrs会透传并作为attribute tree中node中的attrs会透传作为attribute Jan 14, 2025
@li1615882553 li1615882553 changed the title tree中node中的attrs会透传作为attribute tree node中的attrs会透传作为attribute Jan 14, 2025
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