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();
}