Skip to content

Bug: antdv 版窗口 size 变化时 div.ant-app 闪现滚动条问题 #6347

Open
@elkon028

Description

@elkon028

Version

Vben Admin V5

Describe the bug?

添加以下 css 即可让div.ant-app 不出现滚动条

#app {
  /** fix: vben flex layout css bug **/
  > div.ant-app {
    /** 解决闪现滚动条问题 */
    display: flex;
    flex-direction: column;

    > div > aside + div > main {
      /** flex: 1 1 0%; 如果没有最小高属性,可能不会计算出正确的高度 */
      min-height: 0;
    }
  }
}

其它页面 需要才可以滚动

<Page auto-content-height>

不过我实现不明白,为什么会有个 auto-content-heigh 来计算高,直接 flex 布局,<main> overflow: auto 不好吗?是有什么问题?也就是说滚动条在内容区域 <main>,之前也提过这个问题,官方也没说明白这么做会有什么影响。求解惑

要不然搞个preferences 参数 scrollByMain: true,让用户自己决定滚动条在哪里

Reproduction

官方 demo,使用开发者工具调整窗口大小即可重现

https://www.vben.pro/#/system/role

System Info

all

Relevant log output

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions