Sweet Alert

If you want to replace the classic alert box with something that looks amazing, you can use the Sweet Alert 2 Plugin. We have changed the typography and colours for the plugin provided by Tristan Edwards. If you want to see the full documentation, please check out this page.

In order to use the sweet alert, you have to import it the javascript and css.

// js import
import swal from 'sweetalert2'

// style import
import 'sweetalert2/dist/sweetalert2.css'

Basic example

<template>
   <button class="btn btn-default btn-fill" @click="showSwal">Try me!</button>
</template>

<script>
  import swal from 'sweetalert2';
  export default {
   methods: {
       showSwal () {
          swal({
           title: `Here's a message!`,
           buttonsStyling: false,
           confirmButtonClass: 'btn btn-success btn-fill'
         })
       }
     }
  }
</script>
Show Code