beforeRouteEnter(to, from, next) { // 添加背景色 document.querySelector('body').setAttribute('style', 'background-color:#f9f9f9') next() }, beforeRouteLeave(to, from, next) { // 去除背景色 document.querySelector('body').setAttribute('style', '') next() }
beforeRouteEnter(to, from, next) { // 添加背景色 document.querySelector('body').setAttribute('style', 'background-color:#f9f9f9') next() }, beforeRouteLeave(to, from, next) { // 去除背景色 document.querySelector('body').setAttribute('style', '') next() }