I am trying to use Vuex in chrisvfritz/vue-enterprise-boilerplate.
But I am unsure on how to proceed.
My <script> part of a "courses.vue" view component looks like this:
<script>
import Layout from '@layouts/main'
import { mapActions } from 'vuex'
export default {
page: {
title: 'Courses',
meta: [{ name: 'description', content: 'Courses' }],
},
components: { Layout },
mounted: () => {
this.setTitle('courses')
this.setIcon('about balance')
},
methods: {
...mapActions(['setTitle', 'setIcon']),
},
}
</script>
Other answers on how to use Vuex tell me to use:
import store from '@state/store'
new Vue({
store
});
But the "courses.vue" view component does not a a "new Vue" part.
The error I am getting is: "_this.setTitle is not a function".