Skip to content

Commit 7b15292

Browse files
committed
fix(theme): apply latest theme-default
1 parent 15f81f8 commit 7b15292

File tree

4 files changed

+17
-18
lines changed

4 files changed

+17
-18
lines changed

packages/vuepress/vuepress-theme-titanium/layouts/GlobalLayout.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
</template>
99

1010
<script>
11+
import Vue from 'vue'
12+
import { setGlobalInfo } from '@app/util'
1113
import Footer from '../components/Footer.vue'
1214
1315
export default {
@@ -16,6 +18,13 @@ export default {
1618
},
1719
computed: {
1820
layout () {
21+
const layout = this.getLayout()
22+
setGlobalInfo('layout', layout)
23+
return Vue.component(layout)
24+
}
25+
},
26+
methods: {
27+
getLayout () {
1928
if (this.$page.path) {
2029
const layout = this.$page.frontmatter.layout
2130
if (layout && (this.$vuepress.getLayoutAsyncComponent(layout) ||

packages/vuepress/vuepress-theme-titanium/layouts/Layout.vue

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949

5050
<script>
5151
import throttle from 'lodash.throttle'
52-
import nprogress from 'nprogress'
5352
import Vue from 'vue'
5453
5554
import Home from '../components/Home.vue'
@@ -125,21 +124,6 @@ export default {
125124
},
126125
127126
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-
143127
window.addEventListener('scroll', this.onScroll)
144128
},
145129

packages/vuepress/vuepress-theme-titanium/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"dependencies": {
1212
"@vuepress/plugin-nprogress": "^1.0.2",
1313
"@vuepress/plugin-search": "^1.0.2",
14-
"docsearch.js": "^2.6.2",
14+
"docsearch.js": "^2.6.3",
1515
"stylus": "^0.54.5",
1616
"stylus-loader": "^3.0.2",
17-
"vuepress-plugin-container": "^2.0.1"
17+
"vuepress-plugin-container": "^2.0.2"
1818
}
1919
}

packages/vuepress/vuepress-theme-titanium/util/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ export function isActive (route, path) {
5454
}
5555

5656
export function resolvePage (pages, rawPath, base) {
57+
if (isExternal(rawPath)) {
58+
return {
59+
type: 'external',
60+
path: rawPath
61+
}
62+
}
5763
if (base) {
5864
rawPath = resolvePath(rawPath, base)
5965
}

0 commit comments

Comments
 (0)