sweet-alert-vuetify

1,141 3
Install
npm install sweet-alert-vuetify
Latest Version:1.3.0
Vue:2
License:MIT
Last Updated:Mar 8, 2024
Links: GitHub  ·  npm
Maintainer: marcosandrejorge

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,
        },
      },
    },
  });

  this.$swal("loading", {
    config: {
      loading: {
        text: "Salvando...",
      },
    },
  });

  this.$swal("success", {
    config: {
      title: {
        text: "Registro salvo com sucesso!",
      },
    },
  });

  this.$swal("error", {
    config: {
      title: {
        text: "Ocorreu algum problema ao salvar os dados.",
      },
    },
  });
});

CONFIG

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

Props

Thanks to:

Related Packages

vuetify-dialog

Dialog helper for vuetify.js

87,446 192
vuetify-dialogue

Dialog helper for vuetify.js

3,108 7
notivuecation

Promise-based alert, confirm and other notifications for vue.

1,887 5
vue-awesome-notifications

Vue.js version of Awesome Notifications JavaScript library

30,898 104
vue-final-modal

The most powerful yet most light-weight modal library for Vue 3.

3,105,553 1,013

Version History

Version Released Vue License
1.3.0 ^2.6.12 MIT
1.2.5 ^2.6.12 MIT
1.2.0 ^2.6.12 MIT
1.1.1 ^2.6.12 MIT
1.1.0 ^2.6.12 MIT