refactor: set global defaults of vue-scrollto

This commit is contained in:
roschaefer 2019-10-01 17:29:49 +02:00
parent db1bcdd3d2
commit 08e73747bd
4 changed files with 10 additions and 4 deletions

View File

@ -145,7 +145,7 @@ describe('Comment.vue', () => {
it('calls $scrollTo', () => {
wrapper = Wrapper()
jest.runAllTimers()
expect(mocks.$scrollTo).toHaveBeenCalledWith('#commentId-2', 1000)
expect(mocks.$scrollTo).toHaveBeenCalledWith('#commentId-2')
})
})
})

View File

@ -103,7 +103,7 @@ describe('CommentList.vue', () => {
it('calls $scrollTo', () => {
wrapper = Wrapper()
jest.runAllTimers()
expect(mocks.$scrollTo).toHaveBeenCalledWith('#comments', 1000)
expect(mocks.$scrollTo).toHaveBeenCalledWith('#comments')
})
})
})

View File

@ -5,7 +5,7 @@ function scrollToAnchor(anchor, { checkAnchor, $scrollTo }) {
)
if (!checkAnchor(anchor)) return
setTimeout(() => {
$scrollTo(anchor, 1000)
$scrollTo(anchor)
}, 250)
}

View File

@ -142,7 +142,13 @@ export default {
keys: envWhitelist,
},
],
'vue-scrollto/nuxt',
[
'vue-scrollto/nuxt',
{
offset: -100, // to compensate fixed navbar height
duration: 1000,
},
],
'cookie-universal-nuxt',
'@nuxtjs/apollo',
'@nuxtjs/axios',