+
+
Login
+
+
+
+
+
diff --git a/src/components/userlist.vue b/src/components/userlist.vue
index e1e7393..58b39a2 100644
--- a/src/components/userlist.vue
+++ b/src/components/userlist.vue
@@ -18,30 +18,26 @@ export default {
return {
columns: [
{
- heading: 'col1',
- prop: 'prop1'
+ heading: 'ID',
+ prop: 'ID'
},
{
- heading: 'col2',
- prop: 'prop2'
- },
- {
- heading: 'col3',
- prop: 'prop3'
- },
+ heading: 'Benutzername',
+ prop: 'Username'
+ }
],
rows: [
- {prop1: 'r1p1', prop2: 'r1p2', prop3: 'r1p3'},
- {prop1: 'r2p1', prop2: 'r2p2', prop3: 'r2p3'},
- {prop1: 'r3p1', prop2: 'r3p2', prop3: 'r3p3'},
- {prop1: 'r4p1', prop2: 'r4p2', prop3: 'r4p3'},
]
}
},
- methods: {
- add() {
- this.rows.push({'prop1': 'test'});
- }
+ created() {
+ this.$store.dispatch('apiRequest', {
+ endpoint: 'users'
+ })
+ .then(rows => this.rows = rows)
+ .catch(error => {
+ console.log(error);
+ });
}
}
diff --git a/src/main.js b/src/main.js
index 475a200..2d3d383 100644
--- a/src/main.js
+++ b/src/main.js
@@ -5,6 +5,7 @@ import Axios from 'axios';
import App from './app.vue';
import Dashboard from './components/dashboard.vue';
+import LoginForm from './components/forms/login.vue';
import Userlist from './components/userlist.vue';
Vue.use(VueRouter);
@@ -12,12 +13,85 @@ Vue.use(Vuex);
const store = new Vuex.Store({
state: {
+ api: {},
+ navigation: [],
+ login: {},
+ authToken: '',
+ credentials: {}
},
mutations: {
+ setAPI(state, payload) {
+ state.api = payload;
+ },
+ setNavigation(state, payload) {
+ for (var i=0; i