I'm trying to use vue-iziToast
to throw notifications at the top of the page. Since I'm using the same style for all notifications so I decided to use it in form of a component rather than rewriting the code over and over again...
My problem: to create a component in vue, I declare it in main.js
, create a page with its name that has everything, and later, I use it only by creating an html tag with the name of said component.
vue-iziToast
happens completely in the script part of the component.. I just add this line in the method that should trigger it:
this.$toast.success( this.notificationMessage , 'OK', VueIziToast.options.success);
and I have success defined earlier in the code like this:
VueIziToast: {
options: {
success: {
position: "topCenter",
color: "#eaeaea",
messageColor: "success",
messageSize: 18
}
}
},
notificationMessage: "It's ALIVE!!"
and this works perfectly fine within the page, but to move it as a component, I'm unable to create a component with no html part. how will I call it without any html template?