-
Fill the
src/store/index.jswith a global store to handle userloginstate. Add 3 files :mutations.js,getters.js,action.jsintosrc/store. Add 2 actions :loginandlogout. Remove theauth.isUserLoggedproperty fromApp.vue, use a store getter to check if you user is connected. -
Refactor the
todosdata array insideApp.vueinto a specific store modulesrc/store/todos. The foldersrc/store/todosmust contain anindex.js,mutations.js,getters.js,action.jsfiles. You will have 2 actions :addTodoandremoveTodo. Remove thetodosproperty fromApp.vue, user a store getter to get your todos. -
Remove
injectfromLoginForm.vue. Dispatch aloginaction. -
Remove
injectfromTheNavigation.vue. Use a getter formisUserLogged. -
Remove
injectfromTodoList.vue. Use a getter fortodoandisUserLogged. Dispatch aremove todoaction. -
Remove
injectfromAddTodo.vue. Use aisUserLogged. Dispatch aadd todoaction.
npm install
npm run serve
npm run build
npm run lint