版权声明:未经同意,不得随意转载转载 https://blog.csdn.net/lucky541788/article/details/84865964
mounted() {
window.addEventListener('load', () => { // 滚动事件变为 scroll
if (this.$route.path !== '/print') { // /print 表示首页
this.$router.replace('/print') // 切换到首页
}
})
}