mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-20 22:10:45 +03:00
More reliable strategy for getting deepmost component + addition of refresh() method + example & documentation on asynchronous updates
This commit is contained in:
@@ -6,7 +6,15 @@ Vue.use(Vuex)
|
||||
export default new Vuex.Store({
|
||||
// STATE
|
||||
state: {
|
||||
post: null,
|
||||
isLoading: false,
|
||||
// its important that we set some defaults for the current post
|
||||
// otherwise Vue will complain that properties are `null`
|
||||
post: {
|
||||
title: '',
|
||||
content: '',
|
||||
slug: '',
|
||||
published: false
|
||||
},
|
||||
posts: [{
|
||||
slug: 'a-sample-blog-post',
|
||||
title: 'A Sample Blog Post',
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'blog-post',
|
||||
name: 'post',
|
||||
beforeMount () {
|
||||
const { slug } = this.$route.params
|
||||
this.$store.dispatch('getPost', { slug })
|
||||
|
||||
Reference in New Issue
Block a user