2
0
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:
Declan de Wet
2016-11-09 07:26:38 +02:00
parent fa290273df
commit 076832cbd6
18 changed files with 268 additions and 45 deletions
+9 -1
View File
@@ -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',
+1 -1
View File
@@ -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 })