Files
vuepress/lib/default-theme/Layout.vue
T
2018-04-09 11:18:10 -04:00

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>