第一步:
<div class="noticePage" :class="{fixTitle:whether}">
</div>
fixTitle是当达到某种条件时动态添加的class名,whether是判断是否
第二步:
在data里面
data(){
return{
whether:false
}
}
第三步:
在menthods里面,当达到某种条件时
this.whether=true
第一步:
<div class="noticePage" :class="{fixTitle:whether}">
</div>
fixTitle是当达到某种条件时动态添加的class名,whether是判断是否
第二步:
在data里面
data(){
return{
whether:false
}
}
第三步:
在menthods里面,当达到某种条件时
this.whether=true