sweetalert2 Swal.fire delete confirmation code vue js 3

 const delteUser =  async (id) => {

      Swal.fire({

        title: "Are you sure you want to delete this user?",
        showCancelButton: true,
        confirmButtonText: "Confirm",
        showLoaderOnConfirm: true,
        preConfirm: () => {
          return new Promise<void>((resolve) => {
            setTimeout(() => {
              resolve();
            }, 2000);
          });
        },
        allowOutsideClick: false,
      }).then(async (result) => {
        if (result.isConfirmed === true) {
          const resp = await deleteUser(id);
          console.log(resp)
          loadData();
        }
      });
    };



https://sweetalert2.github.io/

Comments

Popular posts from this blog

get urls data and split in the diffrent parts to get endpoint of file name given in last of url and show it .. by put in new array or variable by using -1