Skip to content

fix: use nuxt add component util for toaster#103

Merged
xiaoluoboding merged 1 commit intoxiaoluoboding:mainfrom
danielwaltz:fix-global-component
Nov 20, 2024
Merged

fix: use nuxt add component util for toaster#103
xiaoluoboding merged 1 commit intoxiaoluoboding:mainfrom
danielwaltz:fix-global-component

Conversation

@danielwaltz
Copy link
Copy Markdown
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.
@vercel
Copy link
Copy Markdown

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

@pkg-pr-new
Copy link
Copy Markdown

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
@danielwaltz danielwaltz deleted the fix-global-component branch November 20, 2024 13:05
@danielwaltz
Copy link
Copy Markdown
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