ant-design-vue icon indicating copy to clipboard operation
ant-design-vue copied to clipboard

高度适配问题

Open sweetwisdom opened this issue 1 month ago • 2 comments

  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.2.6

Environment

win11

Reproduction link

https://codepen.io/sweetwisdom/pen/azNzOxr

Steps to reproduce

能不能像el-table那样 自动适配高度(flex),我尝试了:scroll="{y:'calc( 100% )'}":scroll="{y:'max-content'}",都不行 如下图:

Image

demo地址

What is expected?

如上文

What is actually happening?

如上文

sweetwisdom avatar Nov 11 '25 10:11 sweetwisdom

感觉你这个和适配高度没啥关联,设置header吸顶就好了

selicens avatar Nov 13 '25 02:11 selicens

我尝试使用css 解决了这个问题:

  .ant-table-wrapper,
  .ant-spin-container,
  .ant-spin-nested-loading,
  .ant-table {
    height: 100%;
  }

  .ant-table-container {
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  .ant-table-body {
    flex: 1;
  }

Image

参考:demo

sweetwisdom avatar Nov 13 '25 07:11 sweetwisdom