Nearly Perpendicular Macaroons
Join us to discuss the challenges, solutions and best practices for in-house JavaScript code sharing. Tuesday, 12/17 at 10am PT/1pm ET.Sign up here »

vue-swal2-simple-wrapper

1.2.4 • Public • Published

vue-sweetalert2

Build Status

Vue.js wrapper for SweetAlert2.

VueSweetalert2

Get started

npm install -S vue-sweetalert2

or

yarn add vue-sweetalert2

// main.js

import Vue from 'vue';
import VueSweetalert2 from 'vue-sweetalert2';
 
Vue.use(VueSweetalert2);

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

// example-vue-component.vue

<template>
    <button v-on:click="showAlert">Hello world</button>
</template>
 
<script>
export default {
    data() {
        return {};
    },
    methods: {
        showAlert(){
            // Use sweetalret2
            this.$swal('Hello Vue world!!!');
        }
    }
}
</script> 

// Or

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

The documentation for sweetalert2, you can find here.

Install

npm i vue-swal2-simple-wrapper

DownloadsWeekly Downloads

2

Version

1.2.4

License

MIT

Unpacked Size

346 kB

Total Files

9

Last publish

Collaborators

  • avatar