0

I'm following a tutorial in youtube of php laravel. I am having a difficulty of showing the sweetalert2 but I followed all the instruction in the video.

Code in app.js as global the globalJS

import swal from 'sweetalert2';
window.swal = swal;

const toast = swal.mixin({
     toast: true,
     position: 'top-end',
    showConfirmButton: false,
    timer: 3000
});  

window.toast = toast;

Code in my User.vue

  SaveUser() {
  this.$Progress.start();
  this.form.post("api/user");
  this.loadUsers();
  Toast.fire({
    type: "success",
    title: "Signed in successfully"
  });
  this.$Progress.finish();
}

In the documentation Here the code is Toast.fire but in the video that i'm following it is toast({}). I tried both code but its not working. Is there a problem in my code?.

EDIT

I run this code in different computer using Google Chrome Version 0.69.135 Chromium: 77.0.3865.120 (Official Build) (64-bit) and Brave Version 77.0.3865.120 (Official Build) (64-bit) and its working fine.

But in my PC Brave Version 0.68.142 Chromium: 77.0.3865.90 (Official Build) (64-bit) and Google Chrome Version 77.0.3865.120 (Official Build) (64-bit) it's not working.

Community
  • 1
  • 1
KiRa
  • 924
  • 3
  • 17
  • 42

0 Answers0