Mapping in the component

Back to our BlogMap component; we can use the helpers to map the getters and the actions:

import { createNamespacedHelpers } from 'vuex'

const {
mapGetters,
mapActions,
} = createNamespacedHelpers('maps')

export default {
computed: {
...mapGetters([
'center',
'zoom',
]),

mapOptions () {
// ...
},
},

methods: mapActions([
'setCenter',
'setZoom',
]),
}

Now the state of the map is managed in the Vuex store!

..................Content has been hidden....................

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