-
Fill the
src/store/index.js
with a global store to handle userlogin
state. Add 3 files :mutations.js
,getters.js
,action.js
intosrc/store
. Add 2 actions :login
andlogout
. Remove theauth.isUserLogged
property fromApp.vue
, use a store getter to check if you user is connected. -
Refactor the
todos
data array insideApp.vue
into a specific store modulesrc/store/todos
. The foldersrc/store/todos
must contain anindex.js
,mutations.js
,getters.js
,action.js
files. You will have 2 actions :addTodo
andremoveTodo
. Remove thetodos
property fromApp.vue
, user a store getter to get your todos. -
Remove
inject
fromLoginForm.vue
. Dispatch alogin
action. -
Remove
inject
fromTheNavigation.vue
. Use a getter formisUserLogged
. -
Remove
inject
fromTodoList.vue
. Use a getter fortodo
andisUserLogged
. Dispatch aremove todo
action. -
Remove
inject
fromAddTodo.vue
. Use aisUserLogged
. Dispatch aadd todo
action.
npm install
npm run serve
npm run build
npm run lint