Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including vue-swal2-simple-wrapper with all npm packages installed. Try it out:

var vueSwal2SimpleWrapper = require("vue-swal2-simple-wrapper")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

vue-swal2-simple-wrapper v1.2.4

Simple Vue sweetalert2 package


Build Status

Vue.js wrapper for SweetAlert2.


Get started

npm install -S vue-sweetalert2


yarn add vue-sweetalert2

// main.js

import Vue from 'vue';
import VueSweetalert2 from 'vue-sweetalert2';


Now in the global object, you can access all the methods of sweetalret2.

// example-vue-component.vue

    <button v-on:click="showAlert">Hello world</button>

export default {
    data() {
        return {};
    methods: {
            // Use sweetalret2
            this.$swal('Hello Vue world!!!');

// Or

Vue.swal('Hello Vue world!!!');

The documentation for sweetalert2, you can find here.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free