vue项目动态控制数据变动时箭头样式

html代码
<div class="top_precent">
<span :class="{arrow:numPrecent<0}"></span>
</div>
 
css代码
 
span{
font-size: 20px;
line-height: 50px;
}
span:before{
content:'↑ ';
color: red;
//↓↑
}
.arrow:before{
content: '↓';
color:rgb(0,255,173);
}

效果图

致力于前端技术学习与分享,会及时更新博客。
原文地址:https://www.cnblogs.com/caoxueying2018/p/9856983.html