If like me and you have generated your new Vue Project using the Progressive Web Application (PWA) template with the Vue-CLI then there is nothing more you need to do because they have already been pre-installed and all minimum configuration required to start making use of them has already been done, you can happily skip this section.
#Vue router how to#
In how to start a new project in Vue Js I explain how to set this all up and to generate a project. I will also be using a MDB Vue Pro : Material design component framework which will simplify our mark-up. In this example we are going to implement Vuex and Vue-Router in a scenario that almost everyone will encounter in any project, Authentication and Authorization and making use of Json Web Tokens in this example we will be building on ASP.net Core 2.2 JWT Authentication but from a Vue.JS point of view we are actually going to be pretty agnostic where the JWT comes from as in essence it is only going to be from some API end point which we’ll be calling using Axios. Many of the tutorials I found regarding Vuex and Router seemed to overly complex and often involving elements of projects that one will probably not be involved. Actions: They are the functions that perform mutations. mutations: They are the methods that change the data in the state tree. Getters: It is used to fetch data from the state tree. Vuex uses a single state tree, which means that it is a single object that contains all the pieces of data for the application. State: This is an object that contains the data.