Skip to content

Commit cadd046

Browse files
authored
fix(docs): add transition between docs pages, remove scrollToTop. (#4431)
1 parent 8844b2a commit cadd046

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

packages/docs/layouts/default.vue

+1-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ watch(() => breakpoints.smDown, (newValue: boolean) => {
5555
})
5656
5757
const { afterEach } = useRouter()
58-
const { scrollToElement } = useDocsScroll()
5958
afterEach(() => {
60-
scrollToElement()
6159
isSidebarVisible.value = !breakpoints.smDown
6260
isOptionsVisible.value = false
6361
})
@@ -76,7 +74,7 @@ const onMouseMove = (e: MouseEvent) => {
7674
}
7775
7876
onMounted(() => {
79-
scrollToElement()
77+
8078
isSidebarVisible.value = !breakpoints.smDown
8179
setTimeout(() => {
8280
doShowLoader.value = false

packages/docs/pages/[page-config-category]/[page].vue

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="page-config">
3-
<PageConfig
4-
v-if="!isLoading && config"
3+
<PageConfig
4+
v-if="!isLoading && config"
55
:page-config="config"
66
/>
77
<PageConfigSkeleton v-else />
@@ -12,6 +12,7 @@
1212
import { type ConcreteBlock } from '../../modules/page-config/runtime';
1313
1414
definePageMeta({
15+
pageTransition: { name: 'page', mode: 'out-in' },
1516
layout: 'default',
1617
scrollToTop: true,
1718
// See: https://github.com/nuxt/nuxt/issues/13309
@@ -31,9 +32,9 @@ const tabTitlePrefix = 'Vuestic UI'
3132
3233
const router = useRouter()
3334
watch(config, () => {
34-
if (!config.value) {
35+
if (!config.value) {
3536
router.push('/404')
36-
}
37+
}
3738
}, { immediate: true })
3839
3940
watchEffect(() => {
@@ -50,6 +51,16 @@ watchEffect(() => {
5051
</script>
5152

5253
<style lang="scss">
54+
.page-enter-active,
55+
.page-leave-active {
56+
transition: all 0.2s;
57+
}
58+
.page-enter-from,
59+
.page-leave-to {
60+
opacity: 0;
61+
filter: blur(1rem);
62+
}
63+
5364
.page-config-title,
5465
.page-config-subtitle,
5566
.page-config-headline {

0 commit comments

Comments
 (0)