I've used react-toastify with React, which is a very similar package to this one, but the main difference between these two is that with React I an pass a component as a parameter. This allows me to use a reusable component with each toast, specifying in the attributes the title and message:
toast.success(<NotificationContent title="I am a title" message="I am a message" />);
This would awesome as a feature. I did make it work by registering a custom toast that splits the message via a | delimiter:
Vue.toasted.register('htmlError',
(payload) => {
const split = payload.split('|');
const title = split[0];
const message = split[0];
// if there is a message show it with the message
return '<div class="notification-content with-title"><h3>' + title +'</h3>' + message + '</div>'
},
options
);
But this feels like a wobbly hack tbh. Would prefer to use a component I've created with props. Thoughts?
I've used
react-toastify
with React, which is a very similar package to this one, but the main difference between these two is that with React I an pass a component as a parameter. This allows me to use a reusable component with each toast, specifying in the attributes the title and message:This would awesome as a feature. I did make it work by registering a custom toast that splits the message via a
|
delimiter:But this feels like a wobbly hack tbh. Would prefer to use a component I've created with props. Thoughts?