Scroll Behaviour type support in 'app/router.scrollBehavior.ts'
See original GitHub issueright now doing this
`import { Route } from “vue-router”;
const scrollBehavior = (to: Route, from: Route, savedPosition: any) => { console.log(savedPosition); console.log(to); console.log(from); return { x: 0, y: 0 }; }; export default scrollBehavior;`
has no affect. (console.log shows nothing) whereas changing it to .js works fine. im trying to push to a page (kept alive) with the last saved position.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Scroll Behavior | Vue Router
The scrollBehavior function receives the to and from route objects, like Navigation Guards.
Read more >Scroll behaviour VueJS not working properly - Stack Overflow
scrollBehavior happens at the same time. The anchor is not found, so no scrolling; Transition is over, <router-view> correctly mounted/rendered.
Read more >scroll-behavior - CSS: Cascading Style Sheets - MDN Web Docs
The scroll-behavior CSS property sets the behavior for a scrolling box when scrolling is triggered by the navigation or CSSOM scrolling APIs.
Read more >Handling scrolling on Angular router transitions - Medium
Perfectly handling scroll position upon Angular route transitions. ... register a route path and define the expected scroll behavior for ...
Read more >Changing Scroll Behavior with Vue Router | by John Au-Yeung
Vue Router lets us adjust the scrolling behavior the way we like when route loads. This only works if the browser supports history....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@e-lobo Yeah so I was right, there’s no currently workaround for now, I’m myself using a
.js
version in my Nuxt TypeScript projects. I will reach Nuxt Core Team to see if we can enable TypeScript support for this file for Nuxt 3.Extended @aletz13’s version for nuxt
2.15.8