import router from '~router' stopped working
[issue link]Hello. I had a fix for scrolling to top behavior when page transition, but with latest Nuxt releases it stoped working. It was a plugin:
import router from '~router'
router.afterEach((to, from) => {
setTimeout(() => {
if (document) document.body.scrollTop = 0
}, 515)
})
But now this import router from '~router' gives me an error.
Any tips how to fix it? How to access router with latest API?