donal
2018-04-04 9e628c998951ee020076a040e9cc943f0da78962
slight tidy up and prep for Aidan work
3 files modified
30 ■■■■■ changed files
src/components/ListOfTodos.vue 6 ●●●●● patch | view | raw | blame | history
src/components/NewTodo.vue 18 ●●●●● patch | view | raw | blame | history
src/components/TodoItem.vue 6 ●●●● patch | view | raw | blame | history
src/components/ListOfTodos.vue
@@ -35,13 +35,7 @@
    ...mapGetters(["todos"])
  },
  created() {
    // const self = this;
    this.$store.dispatch("loadTodos");
    // EventBus.$on("NEWTODOADDED", function(todo) {
    //   console.info("INFO - NEWTODOADDED received ", todo);
    //   self.todos.push(todo);
    // });
  },
  methods: {
    // updateTodoList(todo) {
src/components/NewTodo.vue
@@ -22,18 +22,12 @@
  },
  methods: {
      newTodoAdded (e) {
          this.newTodo = e.target.value
          console.info('Adding new todo')
          console.info('INFO - ', this.newTodo)
        //   EventBus.$emit('NEWTODOADDED', {
        //       completed: false,
        //       title: this.newTodo,
        //       id: Math.floor(1 + (9999 - 1) * Math.random())
        //   })
          this.$store.dispatch("setNewTodo", this.newTodo)
          this.$store.dispatch("addTodo")
          this.$store.dispatch("clearNewTodo")
          this.newTodo = ''
        console.info('INFO - Adding new todo ', this.newTodo)
        this.newTodo = e.target.value
        this.$store.dispatch("setNewTodo", this.newTodo)
        this.$store.dispatch("addTodo")
        this.$store.dispatch("clearNewTodo")
        this.newTodo = ''
      }
  }
};
src/components/TodoItem.vue
@@ -47,12 +47,12 @@
  methods: {
    markCompleted() {
      this.$store.dispatch("markTodoCompleted", this.todoItem._id);
      console.info("INFO - Mark Item as completed ", this.todoItem.completed);
      console.info("INFO - Mark todo as completed ", this.todoItem.completed);
    },
    markImportant() {
      console.info("INFO - Mark todo as important ", this.todoItem.important);
      // TODO - FILL THIS OUT IN THE LAB EXERCISE
      // this.$store.dispatch("updateTodo", this.todoItem);
      console.info("INFO - ", this.todoItem, this.todoItem.important);
    }
  }
};