怎样对el-table中某一行格式修改,解决设置样式无效的原因

原创
小哥 3年前 (2022-11-14) 阅读数 15 #大杂烩

让我们直截了当:提醒样式无效,可能已被放入scoped的style标签中

放置在普通中style标签的内部很好。

博主使用el-table想要达到改变行样式的效果

在查阅了饥饿文档之后,我发现了一个控制该属性的回调。

所以直接添加

 
          
          
          ...

功能内容:

  // 动态更改行table样式
    tableRowClassName({rowIndex}) {
      console.log(rowIndex === this.taskLocation);
      return rowIndex === this.taskLocation ? shinning : ;
    },

样式代码:

.shinning {
  animation: shinningAnimation 1s linear;
  animation-iteration-count: 2;
  background-color: #e3b4b8;
}
@keyframes shinningAnimation {
  0% {
    opacity: 0;
    background-color: #f5f5f5;
  }
  100% {
    opacity: 1;
    background-color: #e3b4b8;
  }
}

重点 !!! 无法放置样式style scoped中, 置于纯净style标签下方

版权声明

所有资源都来源于爬虫采集,如有侵权请联系我们,我们将立即删除