Vue.use(VueToast, {
// global options
});
var app = new Vue({
el: "#app",
methods: {
open() {
this.$toast.open({
message: "Test message from Vue",
type: "success",
duration: 5000,
dismissible: true
})
}
}
})
<div id="app">
<h1>
Vue 2 toast
</h1>
<button @click="open">
Show toast
</button>
<hr>
<a target="_blank" href="https://ankurk91.github.io/vue-toast-notification">More examples</a>
</div>
body {
font-family: Arial, Verdana, sans-sarif;
background: #f8f8f8;
}
External resources loaded into this fiddle: