1.直接在当前的page内设置如下:
beforeCreate () {
document.querySelector('body').setAttribute('style', 'background-color:#fff')
},
beforeDestroy () {
document.querySelector('body').removeAttribute('style')
}
2.在全局路由钩子那边添加判断:
if (to.meta.name == "release") // 这个为自己添加的meta内容
document.querySelector("body").setAttribute("style","background-color: #fff")
next();
}else {
document.querySelector("body").setAttribute("style","background-color: #EEEEEE")
next();
}