mirror of
https://github.com/wahyd4/vuepress.git
synced 2026-08-24 20:55:51 +10:00
36 lines
744 B
Vue
36 lines
744 B
Vue
<template>
|
|
<div class="theme-container">
|
|
<Sidebar/>
|
|
<Index v-if="$page.path === '/index'" />
|
|
<Page v-else />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import nprogress from 'nprogress'
|
|
import Index from './Index.vue'
|
|
import Page from './Page.vue'
|
|
import Sidebar from './Sidebar.vue'
|
|
|
|
export default {
|
|
components: { Index, Page, Sidebar },
|
|
mounted () {
|
|
nprogress.configure({ showSpinner: false })
|
|
|
|
this.$router.beforeEach((to, from, next) => {
|
|
if (to.path !== from.path) {
|
|
nprogress.start()
|
|
}
|
|
next()
|
|
})
|
|
|
|
this.$router.afterEach(() => {
|
|
nprogress.done()
|
|
})
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style src="prismjs/themes/prism-tomorrow.css"></style>
|
|
<style src="./styles/theme.stylus" lang="stylus"></style>
|