File tree 1 file changed +8
-2
lines changed
packages/@vuepress/core/lib/app/components
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <transition :name =" layout === 'ContentLoading' || !layout ? null : 'fade'" >
2
+ <transition :name =" disableTransition ? null : 'fade'" >
3
3
<component
4
4
v-if =" layout"
5
5
:is =" layout"
@@ -24,13 +24,17 @@ export default {
24
24
25
25
data () {
26
26
return {
27
- layout: ' ContentLoading'
27
+ layout: ' ContentLoading' ,
28
+ noTransition: true
28
29
}
29
30
},
30
31
31
32
computed: {
32
33
$key () {
33
34
return this .pageKey || this .$page .key
35
+ },
36
+ disableTransition () {
37
+ return ! this .layout || this .layout === ' ContentLoading' || this .noTransition
34
38
}
35
39
},
36
40
@@ -62,10 +66,12 @@ export default {
62
66
reloadContent (pageKey ) {
63
67
if (Vue .component (pageKey)) {
64
68
this .layout = pageKey
69
+ this .noTransition = true
65
70
return
66
71
}
67
72
this .layout = ' ContentLoading'
68
73
if (components[pageKey]) {
74
+ this .noTransition = false
69
75
if (! this .$ssrContext ) {
70
76
Promise .all ([
71
77
components[pageKey](),
You can’t perform that action at this time.
0 commit comments