2017-07-10 11:52:10 +00:00
|
|
|
<template>
|
|
|
|
<div class="post">
|
2018-11-24 18:49:19 +00:00
|
|
|
<Component :is="component" />
|
2017-07-10 11:52:10 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
// See https://vuejs.org/v2/guide/components.html#Advanced-Async-Components
|
2018-08-06 00:12:44 +00:00
|
|
|
const getPost = slug => ({
|
2017-07-10 11:52:10 +00:00
|
|
|
component: import(`@/posts/${slug}`),
|
|
|
|
error: require('@/posts/404')
|
|
|
|
})
|
|
|
|
|
|
|
|
export default {
|
2019-07-10 10:45:49 +00:00
|
|
|
beforeCreate () {
|
2017-07-10 11:52:10 +00:00
|
|
|
this.component = () => getPost(this.$route.params.slug)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2022-09-03 12:46:48 +00:00
|
|
|
<style src="@/assets/css/post.css" />
|