例如仅仅在登陆页设置背景。方法有两种。
方法一:在login.vue添加挂载钩子函数,login
.login{
background-color: #364150!important;
}
mounted(){
document.body.className='login'
}
方法二:在style中加scope表示仅在此页中应用,运用position:fixed,在外面包一个div 添加login类
<style scoped>
.login{
background-color: #364150!important;
width: 100%;
height: 100%;
top: 0px;
position: fixed;
}
</style>