[Vuejs]-How to alert and deleted a task using Sweet alert and vue.js?

0👍

probably problem is this statment
try something like this:

    var self = this;
    function(isConfirm) {
              if(isConfirm){
                  self.contacts.splice(index, 1);
                  swal(
                    'Deleted!',
                    'Your file has been deleted.',
                    'success'
                  );

                  return true;
              }
              else{
                return false;
              }

Working version:
https://jsfiddle.net/jyfdh32g/

what i changed:
vue version to last stable – 1.0.25
confirm button action style from: https://limonte.github.io/sweetalert2/ sample.

why $index was not working?

argument order updates: (value, index) in arr, (value, key, index) in
obj $index and $key deprecated

https://github.com/vuejs/vue/issues/2873

Leave a comment