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

🧐[问题]ProTable toolbar没有small模式 #8252

Open
chengmaoning opened this issue Mar 22, 2024 · 5 comments
Open

🧐[问题]ProTable toolbar没有small模式 #8252

chengmaoning opened this issue Mar 22, 2024 · 5 comments

Comments

@chengmaoning
Copy link

🧐 问题描述

ProTable defaultSize="small",但是上面的toolbar仍然很高,看了下padding=16,怎么让toolbar变窄或者跟随small模式。

💻 示例代码

 <ProTable
        columns={columns}
        pagination={false}
        rowKey={'code'}
        bordered
        ghost
        search={false}
        options={false}
        tableAlertOptionRender={false}
        tableAlertRender={false}
        toolbar={{
          actions: [
            <Dropdown.Button
              key="batch_print"
              type="link"
              disabled={!selectedKeys?.length}
             menu ={{}}                 
              >
              打印
            </Dropdown.Button>,
          ],
        }}
        defaultSize="small"
        rowSelection={{
          selectedRowKeys: selectedKeys,
          onChange: setSelectedKeys,
        }}

🚑 其他信息

image

@zhuba-Ahhh
Copy link
Contributor

可行

@chengmaoning
Copy link
Author

可行

大佬有何建议?

@zhuba-Ahhh
Copy link
Contributor

zhuba-Ahhh commented Apr 7, 2024

可行

大佬有何建议?

看了下和你的想法一样应该有两种解决方案,主要toolbar的padding是固定的

  1. defaultSize也传入toolbar,toolbar跟随defaultSize修改对应padding
  2. toolbar新增类似defaultSize控制padding
    个人觉得1ok

@ONLY-yours
Copy link
Collaborator

看起来最后还是走的 antd token,官网用紧凑模式的 demo 倒是对的,感觉包一层 ConfigProvider 就好了

@chengmaoning
Copy link
Author

看起来最后还是走的 antd token,官网用紧凑模式的 demo 倒是对的,感觉包一层 ConfigProvider 就好了

有计划增加这个功能到下一个版本发布不?

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

3 participants