ktquez / vue-disqus

Integrate Disqus count and comments in your application Vue 3, with support for SPA
https://ktquez.github.io/vue-disqus/
MIT License
253 stars 26 forks source link

Doesn't work with Nuxt 3 SSR #102

Open mrleblanc101 opened 1 year ago

mrleblanc101 commented 1 year ago

Probably because you use window in script setup outside the onMounted hook. const currentRoute = ref(window.location.pathname)

Why not simply use const route = useRoute() and route.fullpath instead of referencing the window ?

neural-loop commented 1 year ago

I have the same issue with quasar.

strife-cloud commented 1 year ago

use seems to doing the work at the moment

akereachu commented 1 year ago

Just Wrap it like so: `

`

fgd007 commented 11 months ago

@akereachu This works for the Disqus component, but with the DisqusCount it will complain about 'shortname' missing:

TypeError: Cannot read properties of undefined (reading 'shortname')

So it needs the shortname when the component loads

Edit:

Using the component like this:

<ClientOnly placeholder="loading...">
    <DisqusCount
        :shortname="name"
        :url="url"
        :identifier="id"
    ></DisqusCount>
</ClientOnly>

Combined with just a local import

import { DisqusCount } from 'vue-disqus'

Using