[Vuejs]-Vuejs inline onclick event for multiple

0👍

Just send the todo as a param and do the logic there:

// template
  <button v-on:click="click(todo)">

Then inside your component script:

methods: {
  click(todo){
    switch (todo.text){

     case 'oil':
       //Call a method or do logic here
       this.handleOilTodo();
       break;

       ....

Leave a comment