From 58981fb40d075e0e0fa7a74f55f5378ea830ba67 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Sat, 24 Nov 2018 12:09:32 +0800 Subject: [PATCH] fix: distracting and time wasting after importing smoothing scroll Lervarage 'speedAsDuration: true' to ensure each transition only takes 400ms (Extracted from vuejs.org https://github.com/vuejs/vuejs.org/blob/master/themes/vue/source/js/common.js#L367) --- .../@vuepress/core/lib/app/root-mixins/updateLoadingState.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@vuepress/core/lib/app/root-mixins/updateLoadingState.js b/packages/@vuepress/core/lib/app/root-mixins/updateLoadingState.js index 0a6f62ff06..f42c18e250 100644 --- a/packages/@vuepress/core/lib/app/root-mixins/updateLoadingState.js +++ b/packages/@vuepress/core/lib/app/root-mixins/updateLoadingState.js @@ -6,7 +6,8 @@ export default { this.$vuepress.$set('contentMounted', true) this.$smoothScroll = new SmoothScroll('a[href*="#"]', { - speed: 1000, + speed: 400, + speedAsDuration: true, easing: 'easeInOutCubic' })