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() }
转载于:https://www.cnblogs.com/lanshengzhong/p/10308705.html