mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-25 07:10:33 +03:00
modularize vuex example
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<div>
|
||||
<h3>{{ post.title }}</h3>
|
||||
<p>{{ post.content}}<p>
|
||||
<router-link to="/">Go back home</router-link>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'blog-post',
|
||||
beforeMount () {
|
||||
const { slug } = this.$route.params
|
||||
this.$store.dispatch('getPost', { slug })
|
||||
},
|
||||
computed: mapGetters([
|
||||
'post'
|
||||
]),
|
||||
metaInfo: {
|
||||
title () {
|
||||
return this.post.title
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user