Pass props to custom component
loukkyy opened this issue · comments
Great project! Thanks!
Using Vue3 + Vite, can I pass props to my custom component used for the toast?
Hi, thanks for the feedback! As of v1.0.14, you can with props into the custom component with the withProps
function.
example:
// with props
import { createToast, withProps } from 'mosha-vue-toastify';
import CustomizedContent from "./CustomizedContent.vue";
import 'mosha-vue-toastify/dist/style.css';
export default defineComponent({
setup () {
const toast = () => {
createToast(withProps(CustomizedContent, { yourFavProp: 'bruh' }))
}
return { toast }
}
})
Great feedback, thanks again!
Amazing!
Just bump my version to 1.0.15
but seems withProps
is not exposed:
Uncaught SyntaxError: The requested module '/node_modules/.vite/mosha-vue-toastify.js?v=fe23573f' does not provide an export named 'withProps'
Thanks again!.. That was my bad, something went wrong in the pipeline so the latest build ddnt get published property, can you try version 1.0.17? it should be fine now