File tree Expand file tree Collapse file tree 4 files changed +17
-18
lines changed
packages/vuepress/vuepress-theme-titanium Expand file tree Collapse file tree 4 files changed +17
-18
lines changed Original file line number Diff line number Diff line change 8
8
</template >
9
9
10
10
<script >
11
+ import Vue from ' vue'
12
+ import { setGlobalInfo } from ' @app/util'
11
13
import Footer from ' ../components/Footer.vue'
12
14
13
15
export default {
@@ -16,6 +18,13 @@ export default {
16
18
},
17
19
computed: {
18
20
layout () {
21
+ const layout = this .getLayout ()
22
+ setGlobalInfo (' layout' , layout)
23
+ return Vue .component (layout)
24
+ }
25
+ },
26
+ methods: {
27
+ getLayout () {
19
28
if (this .$page .path ) {
20
29
const layout = this .$page .frontmatter .layout
21
30
if (layout && (this .$vuepress .getLayoutAsyncComponent (layout) ||
Original file line number Diff line number Diff line change 49
49
50
50
<script >
51
51
import throttle from ' lodash.throttle'
52
- import nprogress from ' nprogress'
53
52
import Vue from ' vue'
54
53
55
54
import Home from ' ../components/Home.vue'
@@ -125,21 +124,6 @@ export default {
125
124
},
126
125
127
126
mounted () {
128
- // configure progress bar
129
- nprogress .configure ({ showSpinner: false })
130
-
131
- this .$router .beforeEach ((to , from , next ) => {
132
- if (to .path !== from .path && ! Vue .component (to .name )) {
133
- nprogress .start ()
134
- }
135
- next ()
136
- })
137
-
138
- this .$router .afterEach (() => {
139
- nprogress .done ()
140
- this .isSidebarOpen = false
141
- })
142
-
143
127
window .addEventListener (' scroll' , this .onScroll )
144
128
},
145
129
Original file line number Diff line number Diff line change 11
11
"dependencies" : {
12
12
"@vuepress/plugin-nprogress" : " ^1.0.2" ,
13
13
"@vuepress/plugin-search" : " ^1.0.2" ,
14
- "docsearch.js" : " ^2.6.2 " ,
14
+ "docsearch.js" : " ^2.6.3 " ,
15
15
"stylus" : " ^0.54.5" ,
16
16
"stylus-loader" : " ^3.0.2" ,
17
- "vuepress-plugin-container" : " ^2.0.1 "
17
+ "vuepress-plugin-container" : " ^2.0.2 "
18
18
}
19
19
}
Original file line number Diff line number Diff line change @@ -54,6 +54,12 @@ export function isActive (route, path) {
54
54
}
55
55
56
56
export function resolvePage ( pages , rawPath , base ) {
57
+ if ( isExternal ( rawPath ) ) {
58
+ return {
59
+ type : 'external' ,
60
+ path : rawPath
61
+ }
62
+ }
57
63
if ( base ) {
58
64
rawPath = resolvePath ( rawPath , base )
59
65
}
You can’t perform that action at this time.
0 commit comments