问题:

        

如图,状态正常时显示蓝色,状态冻结时显示红色,即字体颜色随内容改变。

方法:

<template>
<div>
    <el-table-column label="状态" width="200"
        ><template slot-scope="scope">
          <el-button
            type="text"
            :class="scope.row.usersStatus === '正常' ? 'green' : 'red'"
            >{{ scope.row.usersStatus }}</el-button
          >
        </template></el-table-column
      >
</div>
</template>
<style scoped>
/* @import url(); 引入css类 */
.red {
  color: red !important;
}
.green {
  color: #409eff !important;
}
</style>

版权声明:本文为qq_45094823原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/qq_45094823/article/details/124366818