ant-design / pro-components

🏆 Use Ant Design like a Pro!
https://pro-components.antdigital.dev
MIT License
4.3k stars 1.36k forks source link

为什么ProTable的search里的submitterColSpanProps里的span属性一定要number类型? #8643

Open 704998200 opened 2 months ago

704998200 commented 2 months ago

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

🧐 问题描述

submitterColSpanProps的span设置为number类型后,当页面宽度比较小的时候并在submit区域添加多一个按钮后,submit区域就有可能超出页面

💻 示例代码

submit区域有可能超出页面

search={{
          layout: "horizontal",
          optionRender: (searchConfig, props, dom) => [
            ...dom,
            <Divider key={"divider"} type="vertical" />,
            <AddCompany key={"addCompany"} onSuccess={onSuccess} />,
          ],
          labelWidth: "auto",
          collapseRender: false,
          collapsed: false,
          submitterColSpanProps: { span: 8, flex: "auto" },
        }}

submit区域可以正常换行

   search={{
          layout: "horizontal",
          optionRender: (searchConfig, props, dom) => [
            ...dom,
            <Divider key={"divider"} type="vertical" />,
            <AddCompany key={"addCompany"} onSuccess={onSuccess} />,
          ],
          labelWidth: "auto",
          collapseRender: false,
          collapsed: false,
          submitterColSpanProps: { span: "auto" as unknown as number, flex: "auto" },
        }}

🚑 其他信息

类型定义 image span设置为number超出页面 image span设置为auto正常显示 image