-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Globally provide custom component #66
Comments
I guess I could provide a custom return {
provide: { toast: (...args) => toast(MyCustomComponent, { ...args }) },
}; |
you can use custom component instead, like:
<template>
<div>
<el-button type="primary" class="bg-[#f60] text-white">
Primary {{ name }}
</el-button>
</div>
</template>
<script setup lang="ts">
defineProps({
name: {
type: String,
default: 'test',
},
});
</script>
toast.loading(Custom, {
contentProps: { name: 'sended' },
expandCustomProps: true,
}); |
@jerrywu001 i don't think you understood me properly. I want to set to component globally in the plugin option instead of passing it to the toast function for every involution. |
I guess I'll just do a custom composable that wrap the toast function as state here #66 (comment) |
got it |
In Render more than string, I see I can provide a custom component, the annoying part is that I need to pass the component every time I call
toast()
, is there a way to define it globally ?I want to style my Toast using
tailwindcss
classes, so I need to provide a custom component to do this.This would be especially usefull in a Nuxt context:
The text was updated successfully, but these errors were encountered: