Blog Map changes

We need to make some changes to the BlogMap component to integrate our Vuex store.

  1. In the BlogMap.vue component, we can add the Vuex helpers for the posts namespaced module, while renaming the ones we already have for the maps module:
      // Vuex mappers
// maps module
const {
mapGetters: mapsGetters,
mapActions: mapsActions,
} = createNamespacedHelpers('maps')
// posts module
const {
mapGetters: postsGetters,
mapActions: postsActions,
} = createNamespacedHelpers('posts')
  1. Add the draft getter:
      computed: {
...mapsGetters([
'center',
'zoom',
]),
...postsGetters([
'draft',
]),
// ...
},
  1. Add the setDraftLocation action as well:
      methods: {
...mapsActions([
'setCenter',
'setUserPosition',
'setZoom',
]),

...postsActions([
'setDraftLocation',
]),
},
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.38.125