add view Page to display static pages && add routing
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
||||
<main-header />
|
||||
|
||||
<main id="main">
|
||||
<router-view />
|
||||
<router-view :key="$route.path" />
|
||||
</main>
|
||||
|
||||
<nodes-history />
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<template>
|
||||
<div class="static-page">
|
||||
<b-overlay
|
||||
:show="page === undefined"
|
||||
z-index="0"
|
||||
>
|
||||
<page-view
|
||||
v-if="page"
|
||||
:page="page" slug="static"
|
||||
@close="$router.push({ name: 'home' })"
|
||||
/>
|
||||
</b-overlay>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { PageView } from '@/components/layouts'
|
||||
|
||||
|
||||
export default {
|
||||
name: 'Page',
|
||||
|
||||
props: {
|
||||
id: { type: Number, required: true }
|
||||
},
|
||||
|
||||
components: {
|
||||
PageView
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
page: undefined
|
||||
}
|
||||
},
|
||||
|
||||
async created () {
|
||||
this.page = await this.$store.dispatch('QUERY_PAGE_BY_ID', Number(this.id))
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.static-page {
|
||||
min-height: 100%;
|
||||
|
||||
.b-overlay-wrap {
|
||||
position: static !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -59,9 +59,10 @@ export default [
|
||||
},
|
||||
|
||||
{
|
||||
name: 'blog',
|
||||
path: '/blog',
|
||||
component: () => import(/* webpackChunkName: "blog" */ '@/pages/Blog')
|
||||
name: 'pages',
|
||||
path: '/pages/:id',
|
||||
props: true,
|
||||
component: () => import(/* webpackChunkName: "blog" */ '@/pages/Page')
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user