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

👑 [需求] ProColumnType.search 允许定义为true (ts) #8274

Closed
acfasj opened this issue Apr 6, 2024 · 0 comments
Closed

👑 [需求] ProColumnType.search 允许定义为true (ts) #8274

acfasj opened this issue Apr 6, 2024 · 0 comments

Comments

@acfasj
Copy link
Contributor

acfasj commented Apr 6, 2024

🔩 所属模块或组件

pro table

🥰 需求描述

pro table 的 column, 允许把 search 定义为 true

Now:
image

Expected:
true, ts不会报错

⛰ 功能需求适用场景

个人需求是 search 是默认隐藏的, 只有用户想展示的时候才展示, 会封装多一层进行下面的操作:

columns={columns.map(item => ({
  ...item,
  search: Reflect.has(item, 'search') ? item.search : false
})}

🧐 解决方案

改一下 ts 类型定义就行了:
image

🚑 其他信息

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

2 participants