[Vuejs]-Using V-for in checkboxes in vue

0👍

You need to check inside your function saveMarks what the state of the checkbox is and only then save.
Like so:

 saveMarks: function(item,event) {
            var self=this;
            if (event.target.checked === true){
            axios({
              method:"POST",
              url:"/Student/"+this.studid+"/"+item.id, 
             // url:"/Student/2/2", 
                  headers: {
                      'content-type': 'application/json',
                  },
                  data:{

                        }

                })

                console.log("record  saved");
               }else{

                    console.log("record not saved");
                    //return

                }

Leave a comment