-
hello, this is my code
this works fine if the component has a static message to show. I know how to pass props to component inside the template
but how to pass the custom message to the toast outside the template tag, like in the catch fuction in axios request? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello! You can pass props (and event listeners) to the rendered component by providing the component as an object: import ErrorToast from "@/Pages/Components/ErrorToast"
this.$toast.error(
{
component: ErrorToast,
props: {
message: "custom message",
},
listeners: {
click: () => console.log("Clicked!"),
},
},
options
) You can read more about it in the docs :) |
Beta Was this translation helpful? Give feedback.
Hello!
You can pass props (and event listeners) to the rendered component by providing the component as an object:
You can read more about it in the docs :)