SweetAlert - The demo of how to make a Vue plugin
JavaScript HTML
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
build 0.1.18 Jul 21, 2017
example 0.1.17 Mar 5, 2017
src fix Jul 26, 2016
.babelrc init Jun 14, 2016
.gitignore 0.1.17 Mar 5, 2017
LICENSE add license Jun 14, 2016
README.md depend on sweetalert2 Jun 18, 2016
index.html depend on sweetalert2 Jun 18, 2016
package.json 0.1.18 Jul 21, 2017
webpack.base.config.js wrap sweetalert Jun 15, 2016
webpack.config.js wrap sweetalert Jun 15, 2016
webpack.dev.config.js wrap sweetalert Jun 15, 2016

README.md

vue-sweetalert

The demo of how to make a Vue plugin -- sweetalert

npm npm npm

if you want to learn more about sweetalert2's api, please goto its homepage https://github.com/limonte/sweetalert2

Why to depend on sweetalert2

The original SweetAlert plugin is currently unsupported, there's SweetAlert2. Consider to base your plugin on it.
Migration guide: https://github.com/limonte/sweetalert2/wiki/Migration-from-SweetAlert-to-SweetAlert2

Install

npm install vue-sweetalert --save

API

this.$swal(...)

Usage

html

<body>
  <button v-on:click="clickHandler">swal</button>
  ...
</body>

js

import Vue from 'vue'
import VueSweetAlert from 'vue-sweetalert'

Vue.use(VueSweetAlert)

new Vue({
  el: 'body',
  methods: {
    clickHandler() {
      this.$swal('hello')
    }
  }
})

LICENSE

MIT