解决element ui Table 最后的数据没有子数据也有展开按钮的问题

先添加类

:row-class-name="getRowClass"

写个方法

html 复制代码
    getRowClass(row, rowIndex) {
      let data = row.row;
      let res = [];
      if (data.realyTask && data.realyTask.length > 0) {
        res.push('row-expand-has')
        return res;
      } else {
        res.push('row-expand-unhas')
        return res;
      }
    },

最后css

html 复制代码
>>>.row-expand-unhas .el-icon-arrow-right{
  // pointer-events: none;
  opacity: 0;
}
相关推荐
阿里加多3 小时前
第 4 章:Go 线程模型——GMP 深度解析
java·开发语言·后端·golang
likerhood3 小时前
java中`==`和`.equals()`区别
java·开发语言·python
qq_283720053 小时前
Python Celery + FastAPI + Vue 全栈异步任务实战
vue.js·python·fastapi
小李子呢02114 小时前
前端八股性能优化(2)---回流(重排)和重绘
前端·javascript
zs宝来了4 小时前
AQS详解
java·开发语言·jvm
程序员buddha4 小时前
深入理解ES6 Promise
前端·ecmascript·es6
吴声子夜歌4 小时前
ES6——Module详解
前端·ecmascript·es6
telllong4 小时前
Python异步编程从入门到不懵:asyncio实战踩坑7连发
开发语言·python
吴声子夜歌5 小时前
Vue3——Vue实例与数据绑定
前端·javascript·vue.js