html:
原本标签:<div :class="{'active_':!aActive}" >
现在标签:<div :class="{'active_':!aActive,'active__new':aActive}" >
通过类名切换不同标签里面的背景图
css:
.active_ { //第一张背景图
z-index:100;
background: url("./assets/bg.png") ;
background-size: 100% 100% !important;
background-repeat: no-repeat !important;
}
.active__new { //第二张背景图
z-index:100;
background: url("./assets/bg_aaa.png") !important;
background-size: 100% 100% !important;
background-repeat: no-repeat !important;
}
底部标签,点击标签 通过类名切换背景图
最新推荐文章于 2023-03-09 14:09:19 发布