vue——刷新页面回首页(包括一些滚动同理)
mounted() {window.addEventListener('load', () => { // 滚动事件变为 scrollif (this.$route.path !== '/print') { // /print 表示首页this.$router.replace('/print') // 切换到首页...
·
mounted() {
window.addEventListener('load', () => { // 滚动事件变为 scroll
if (this.$route.path !== '/print') { // /print 表示首页
this.$router.replace('/print') // 切换到首页
}
})
}
更多推荐
已为社区贡献19条内容
所有评论(0)