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

Something wrong when used in Nuxt 3 #3

Open
annamithairil opened this issue May 17, 2024 · 2 comments
Open

Something wrong when used in Nuxt 3 #3

annamithairil opened this issue May 17, 2024 · 2 comments

Comments

@annamithairil
Copy link

annamithairil commented May 17, 2024

can not work in SSR mode,when i use it and refresh the page, the website wents to /, when wrappered by

<client-only>
        <VueCompareImage
          :left-image="vnsw1"
          :right-image="vnsw2"
        />
 </client-only>

it became normal

@zedjarvis
Copy link
Owner

Hello @annamithairil, yes the component is rendered only on the client side hence the need to wrap it with the <client-only> tag

@stephiescastle
Copy link

Also want to note that if you are trying to add it as a Nuxt plugin, you'll want to use the file name *.client.js

// vue-compare-image.client.js

import VueCompareImage from 'vue3-compare-image'

export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.vueApp.use(VueCompareImage)
})

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

No branches or pull requests

3 participants