[vue] begin collection store

This commit is contained in:
Eduardo humberto 2017-12-12 16:22:46 -02:00
parent 2ee73b7fe9
commit c6666accf0
4 changed files with 11 additions and 3 deletions

View File

@ -1,4 +1,7 @@
import axios from '../../../axios/axios';
export const getItems = () => {
export const fetchItems = ({ commit, state }) => {
axios.get('/')
.then(res => {})
.catch(error => console.log( error ));
}

View File

@ -2,7 +2,6 @@ import * as actions from './actions';
import * as getters from './getters';
import * as mutations from './mutations';
const state = {
items: []
};

View File

@ -0,0 +1,3 @@
export const getItems = state => {
return state.items;
}

View File

@ -0,0 +1,3 @@
export const setItems = ( state, items ) => {
state.item = items;
}