sweet-alert-vuetify

npm install sweet-alert-vuetify --save

Usage no npm install needed!

<script type="module">
  import sweetAlertVuetify from 'https://cdn.skypack.dev/sweet-alert-vuetify';
</script>

README

Install

npm install sweet-alert-vuetify --save

Use

import SweetAlertVuetify from 'sweet-alert-vuetify';
components: { SweetAlertVuetify }
<sweet-alert-vuetify
  v-model="showConfirm"
  @clickButtonOk="save()"
  @clickButtonCancel="cancel()"
  alertDefault="confirm"
  :config="{
    title: 'Deseja realmente continuar?',
    buttonCancel: {
      text: 'Cancelar'
    }
  }"
/>

OR

import SweetAlertVuetify from 'sweet-alert-vuetify';
Vue.use(SweetAlertVuetify, vuetify);

Use

async showAlert() {
  let confirm = await this.$swal("confirm", {
    hideOverlay: true,
    config: {
      iconVisible: false,
      title: {
        text: "Você tem certeza que deseja continuar?",
        style: {
          style: {
            fontSize: "12px",
            color: "red"
          }
        }
      },
      buttonCancel: {
        text: "Não, voltar",
        style: {
          text: false,
          color: "#687CEA",
          class: "white--text",
          depressed: true,
          width: "30%",
          maxWidth: "400px",
          rounded: true,
        },
      },
      buttonOk: {
        text: "Sim, continuar",
        style: {
          text: false,
          color: "#687CEA",
          class: "white--text",
          depressed: true,
          width: "40%",
          maxWidth: "400px",
          rounded: true,
        },
      },
    },
  });
});

CONFIG

//vue.config.js
module.exports = {
  transpileDependencies: ["vuetify", "sweet-alert-vuetify"]
};

Props

Thanks to: