mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
fix(vue-app): check for Page.options before looking within (#8612)
closes #8234
This commit is contained in:
parent
51653a8fc5
commit
3265e94979
@ -31,9 +31,9 @@ export default function (to, from, savedPosition) {
|
||||
// Scroll to the top of the page if...
|
||||
if (
|
||||
// One of the children set `scrollToTop`
|
||||
(Pages.some(Page => Page.options.scrollToTop) ||
|
||||
(Pages.some(Page => Page.options && Page.options.scrollToTop) ||
|
||||
// scrollToTop set in only page without children
|
||||
(Pages.length < 2 && Pages.every(Page => Page.options.scrollToTop !== false))) &&
|
||||
(Pages.length < 2 && Pages.every(Page => !Page.options || Page.options.scrollToTop !== false))) &&
|
||||
// route changes
|
||||
to !== from
|
||||
) {
|
||||
|
Loading…
Reference in New Issue
Block a user