vue中CSS使用:after伪类实现点击改变样式
1.如图2.实现中data中actived一开始为false方法中gbys () {this.ddh = JSON.parse(window.localStorage.getItem(‘ddh’))console.log(this.yhid)console.log(this.fxid)this.actived = !this.activedconsole.log(this.actived)},st
·
1.如图
2.实现
中
data中actived一开始为false
方法中
gbys () {
this.ddh = JSON.parse(window.localStorage.getItem(‘ddh’))
console.log(this.yhid)
console.log(this.fxid)
this.actived = !this.actived
console.log(this.actived)
},
style中
.actived{
position: relative;
border: 1px solid red !important;
}
.actived:after{
content: ‘’;
background: url(’…/…/assets/img/duigou.png’) no-repeat bottom right;
position: absolute;
width: 45px;
height: 45px;
bottom: 0;
right: 0;
}
更多推荐
已为社区贡献3条内容
所有评论(0)