-
Notifications
You must be signed in to change notification settings - Fork 0
/
layout.vue
36 lines (32 loc) · 691 Bytes
/
layout.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<template>
<div>
<Sidebar />
<main id="main">
<component :is="layout" />
</main>
</div>
</template>
<script>
import Sidebar from './components/sidebar/index';
import Home from './home';
import Post from './post';
export default {
/* eslint-disable vue/no-unused-components */
components: {
Sidebar,
Home,
Post
},
computed: {
layout() {
if (this.$route.path === this.$site.base) {
return 'home';
}
return this.$page.frontmatter.layout || 'post';
}
}
};
</script>
<style src="minireset.css"></style>
<style src="./style/theme.styl" lang="stylus"></style>
<style src="./style/mobile.styl" lang="stylus"></style>