mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-02 10:27:15 +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...
|
// Scroll to the top of the page if...
|
||||||
if (
|
if (
|
||||||
// One of the children set `scrollToTop`
|
// 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
|
// 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
|
// route changes
|
||||||
to !== from
|
to !== from
|
||||||
) {
|
) {
|
||||||
|
Loading…
Reference in New Issue
Block a user