el-table表格数据行中添加icon---插槽使用

  • icon在哪格显示就在哪格写
<el-table-column
  prop="amount2"
  sortable
  label="周涨幅">
  <template slot-scope="scope">
    {{ scope.row. amount2}}
    <span v-if="scope.row.amount2>2" class="el-icon-caret-bottom" style="color:rgb(194, 58, 63);"></span>
    <span v-if="scope.row.amount2<2" class="el-icon-caret-top" style="color:rgb(103, 194, 58);"></span>
  </template>
</el-table-column>

 

  • 效果图

   

 

posted @ 2023-03-27 10:05  会转圈圈的哆瑞米  阅读(170)  评论(0编辑  收藏  举报