scope.$index

        <el-table-column
              label="序号"
              align="center"
              width="80"
              >
                <template slot-scope="scope">
                  <div :class="listBgColor[scope.$index+1+myIndex]">
                    {{scope.$index+1+myIndex}}
                  </div>
                </template>
              </el-table-column>        

前三项加置顶背景

 data() {
    return {
    
      listBgColor: {
        '1': 'listBgFirst',
        '2': 'listBgSecond',
        '3': 'listBgTthird',
      },


    }
}

背景样式

.listBgFirst{
  color:#fff;
  background: url("../../../assets/img/first.png") no-repeat
    center;
  background-position-x: 17px;
  background-size: 32px 20px;
}
.listBgSecond{
  color:#fff;
  background: url("../../../assets/img/second.png") no-repeat
    center;
  background-size: 32px 20px;
  background-position-x: 17px;
}
.listBgTthird{
  color:#fff;
  background: url("../../../assets/img/third.png") no-repeat
    center;
  background-size: 32px 20px;
  background-position-x: 17px;
}

 

相关文章:

  • 2022-12-23
  • 2021-08-16
  • 2021-10-30
  • 2022-12-23
  • 2021-06-02
  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
猜你喜欢
  • 2021-11-04
  • 2021-07-02
  • 2021-06-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-13
相关资源
相似解决方案