1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
| export default {
| SET_LOADING(state, bool) {
| state.loading = bool;
| },
| SET_TODOS(state, todos) {
| state.todos = todos;
| },
| SET_NEW_TODO(state, todo) {
| state.newTodo = todo;
| },
| ADD_TODO(state, todo) {
| console.log('INFO - add todo', todo);
| state.todos.push(todo);
| },
| REMOVE_TODO(state, todo) {
| var todos = state.todos;
| todos.splice(todos.indexOf(todo), 1);
| },
| CLEAR_NEW_TODO(state) {
| state.newTodo = '';
| console.log('INFO - clearing new todo');
| },
| CLEAR_ALL_TODOS(state) {
| state.todos = [{ title: "", id: "0", complete: false, important: false }];
| console.log('INFO - clearing all todos');
| }
| };
|
|