vue 控制伪类元素的显示
<view :class='switchBox===true?'list_cen border':'list_cen'"></view>.list_cen {padding-top: 31/100rem;width: 100%;position: relative;&.border::after {content: " ";position: absolute;..
·
<view :class='switchBox===true?'list_cen border':'list_cen'"></view>
.list_cen {
padding-top: 31/100rem;
width: 100%;
position: relative;
&.border::after {
content: " ";
position: absolute;
left: 0;
bottom: -0.4rem;
height: 2px;
width: 100%;
background: rgba(232, 232, 232, 1);
}
}
在list_cen盒子后面追加横线,只要动态控制border这个类名就可以了
更多推荐
已为社区贡献7条内容
所有评论(0)