fix(vue-app): check for Page.options before looking within (#8612)

closes #8234
This commit is contained in:
Daniel Roe 2021-01-11 17:04:33 +00:00 committed by GitHub
parent 51653a8fc5
commit 3265e94979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
) {