PanJiaChen / vue-element-admin

:tada: A magical vue admin https://panjiachen.github.io/vue-element-admin
MIT License
87.07k stars 30.39k forks source link

el-table 第一列固定,且对单元格设置多行省略css后Safari浏览器上表格行高出现错乱 #4152

Closed Anyhow-Lee closed 1 year ago

Anyhow-Lee commented 1 year ago

Bug report(问题描述)

需要每个单元格展示超出三行省略

Steps to reproduce(问题复现步骤)

以 vue-element-admin 官方代码为例

  1. 设置第一列fixed,且每一列均设置width(无 min-width)

  2. src/styles/index.scss 中写css

    .el-table .cell{
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    word-break: break-all;
    line-height: 23px;
    }

    此时效果为:

    • 左侧固定列错位
    • 固定列只展示14个数据 image image
  3. 在网上看见有说增加 max-height 任然无法完全解决

    .el-table .cell{
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    word-break: break-all;
    line-height: 23px;
    max-height: 69px;
    }

    此时效果: image

image