Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Vue.nextTick().then(() => {
if (document.body.clientHeight >= scrollTop + clientHeight) {
window.scrollTo(0, scrollTop)
}
ls.remove(path)
})
}
beforeRouteLeave (to, from, next) {
const scrollTop = document.body.scrollTop
const path = this.$route.path
if (scrollTop) ls.set(path, scrollTop)
else ls.remove(path)
next()
}
}