From a9847bc59c3a3afd5d3d6f6ece6a343e7e856b22 Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Mon, 25 Feb 2019 01:31:05 +0300 Subject: [PATCH] Users table --- src/store/modules/users.js | 7 +++- src/views/layout/Layout.vue | 1 - src/views/layout/components/Navbar.vue | 48 -------------------------- src/views/users/index.vue | 45 +++++++++++++++++++++--- 4 files changed, 47 insertions(+), 54 deletions(-) diff --git a/src/store/modules/users.js b/src/store/modules/users.js index c3603077..e96dbe09 100644 --- a/src/store/modules/users.js +++ b/src/store/modules/users.js @@ -2,11 +2,15 @@ import { fetchUsers } from '@/api/users' const user = { state: { - fetchedUsers: [] + fetchedUsers: [], + loading: true }, mutations: { SET_USERS: (state, users) => { state.fetchedUsers = users + }, + SET_LOADING: (state, status) => { + state.loading = status } }, actions: { @@ -14,6 +18,7 @@ const user = { const response = await fetchUsers() commit('SET_USERS', response.data) + commit('SET_LOADING', false) } } } diff --git a/src/views/layout/Layout.vue b/src/views/layout/Layout.vue index 0e14f160..f24ef044 100644 --- a/src/views/layout/Layout.vue +++ b/src/views/layout/Layout.vue @@ -4,7 +4,6 @@
-
diff --git a/src/views/layout/components/Navbar.vue b/src/views/layout/components/Navbar.vue index 5c3bcda4..d7bc3cb8 100644 --- a/src/views/layout/components/Navbar.vue +++ b/src/views/layout/components/Navbar.vue @@ -1,32 +1,9 @@