Skip to content

Commit

Permalink
fix(module): fixed the client-only warning
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoluoboding committed Nov 21, 2024
1 parent 0f456eb commit 5cb93ff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ pnpm build:dev
```html
<!-- App.vue -->
<template>
<ClientOnly>
<Toaster />
</ClientOnly>
<Toaster />
<button @click="() => toast('My first toast')">Render a toast</button>
</template>

Expand Down
4 changes: 1 addition & 3 deletions playground/app.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<template>
<div>
<ClientOnly>
<Toaster position="top-center" />
</ClientOnly>
<Toaster position="top-center" />

<button @click="$toast('Render a toast')">Render a toast</button>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const module: NuxtModule<ModuleOptions> = defineNuxtModule<ModuleOptions>({
addComponent({
name: 'Toaster',
export: 'Toaster',
filePath: 'vue-sonner'
filePath: 'vue-sonner',
mode: 'client'
})

addPlugin({
Expand Down

0 comments on commit 5cb93ff

Please sign in to comment.