Closed everything-is-going-to-be-okay closed 5 years ago
for example i have component.vue file
<template> <div> <vue-toastify :status="settings" /> <button @click="clicked">click to show Toastify</button> </div> </template> <script> export default { data() { return { settings: { title: "toastified!", body: "This is the body.", canTimeout: true, defaultTitle: true, duration: 1000 } } }, methods: { clicked() { // what code should I write to call toastify? } } } </script>
p.s. your component is amazing
To trigger a notification you can $emit an event with your defined evenhandler. Eg.:
EventBus.$emit('vtNotify', this.settings);
You can find a working example of this in the App.vue
for example i have component.vue file