From: Mostafa Salama Date: Sun, 11 Oct 2020 11:00:37 +0000 (+0200) Subject: docs: improve scroll-behavior.md (#522) [skip ci] X-Git-Tag: v4.0.0-rc.1~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c32a4f0fb619be368fe1216a6d8282c94cbefc5a;p=thirdparty%2Fvuejs%2Frouter.git docs: improve scroll-behavior.md (#522) [skip ci] fixing the syntax in scroll behavior function, the `el: '#main'` should be in a comment and the element **el** should be in the return object --- diff --git a/docs/guide/advanced/scroll-behavior.md b/docs/guide/advanced/scroll-behavior.md index 148247e0..7063f265 100644 --- a/docs/guide/advanced/scroll-behavior.md +++ b/docs/guide/advanced/scroll-behavior.md @@ -35,10 +35,10 @@ You can also pass a CSS selector or a DOM element via `el`. In that scenario, `t const router = createRouter({ scrollBehavior (to, from, savedPosition) { // always scroll 10px above the element #main - el: '#main', + // el: '#main' // could also be // el: document.getElementById('main'), - return { top: -10 } + return { el: '#main', top: -10 } } }) ```