JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://unpkg.com/vue-notifyjs/dist/vue-notifyjs.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/vue-notifyjs/themes/default.css">
<div id="app">
<div>
<notifications></notifications>
<button @click="addNotification('top','right')">Add Top right</button>
<button @click="closeAll">Close all</button>
</div>
</div>
JavaScript
Vue.use(vueNotifyjs)
new Vue({
el: '#app',
methods: {
addNotification(verticalAlign = 'top', horizontalAlign = 'right') {
this.$notify({
message: 'Welcome ',
horizontalAlign: horizontalAlign,
verticalAlign: verticalAlign,
type: "success"
})
},
closeAll() {
let totalNotifications = this.$notifications.state.length;
for (var i = 0; i < totalNotifications; i++) {
this.$notifications.state.pop();
}
}
}
})