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

[Table] 表格头部筛选TableColumnFilter,期望能支持设置attrs #2627

Closed
vonlyinno opened this issue Jul 27, 2023 · 8 comments
Closed
Assignees
Labels
to be published fixed, not be published

Comments

@vonlyinno
Copy link

tdesign-vue 版本

1.4.7

重现链接

No response

重现步骤

表格的表头筛选,支持自定义组件并设置props,但存在某些自定义组件是基于基础组件二次封装的,会透传所有$attrs给基础组件(比如我们封装的员工选择器基于基础select),但目前无法设置attrs。
image

查看源代码,发现即使指定 attrs,也会强行转为props传递,不符合预期。
image

期望结果

表格的表头筛选,能设置component的attrs

实际结果

No response

框架版本

2.6.14

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

No response

@github-actions
Copy link
Contributor

👋 @vonlyinno,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@github-actions
Copy link
Contributor

♥️ 有劳 @chaishi @nined9 @yanxugong @chuyueZhang 尽快确认问题。
确认有效后将下一步计划和可能需要的时间回复给 @vonlyinno

@chaishi
Copy link
Collaborator

chaishi commented Jul 27, 2023

Vue3 单独可以自动识别 props/attrs,Vue2 确实需要单独实现一下。

@vonlyinno
Copy link
Author

Vue3 单独可以自动识别 props/attrs,Vue2 确实需要单独实现一下。

求尽快支持,感谢

@vonlyinno
Copy link
Author

再咨询下,上面截图中,对自定义组件取props,第二个参数为什么只支持将attrs作为props透传呢?如果我同时设置了props或者其他属性比如class,会被丢弃
const tProps = typeof b === 'object' && 'attrs' in b ? b.attrs : {};

@chaishi
Copy link
Collaborator

chaishi commented Jul 27, 2023

resolved in #2629
新增 TableColumnFilter.attrs TableColumnFilter.classNames TableColumnFilter.style

@chaishi
Copy link
Collaborator

chaishi commented Jul 27, 2023

再咨询下,上面截图中,对自定义组件取props,第二个参数为什么只支持将attrs作为props透传呢?如果我同时设置了props或者其他属性比如class,会被丢弃
const tProps = typeof b === 'object' && 'attrs' in b ? b.attrs : {};

不同的写法,走不同的 分支代码。

image

@xiaosansiji
Copy link
Collaborator

xiaosansiji commented Aug 2, 2023

fixed in 1.5.2

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

No branches or pull requests

3 participants