Skip to content
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

fix: use nuxt add component util for toaster #103

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

danielwaltz
Copy link
Contributor

This allows <Toaster /> component types to be available, and the Toaster component will only be loaded if it is actually imported. Thanks!

This allows Toaster component types to be available, and the Toaster component will only be loaded if it is actually imported.
Copy link

vercel bot commented Nov 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vue-sonner ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 4:33pm

Copy link

pkg-pr-new bot commented Nov 20, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/xiaoluoboding/vue-sonner@103

commit: 17adfb9

@xiaoluoboding xiaoluoboding merged commit a302447 into xiaoluoboding:main Nov 20, 2024
4 of 5 checks passed
@danielwaltz danielwaltz deleted the fix-global-component branch November 20, 2024 13:05
@danielwaltz
Copy link
Contributor Author

@xiaoluoboding Thanks for merging this so quickly! Also wanted to note here that in order to force the component to be client-only, you can also pass a mode to addComponent that forces it like you can with addPlugin:

addComponent({
  name: 'Toaster',
  export: 'Toaster',
  filePath: 'vue-sonner'
  mode: 'client', // <- mode here
})

This may be easier and cleaner than needing to add a <ClientOnly> wrapper around it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants