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

Override identifier in Disqus component #41

Closed bbedward closed 4 years ago

bbedward commented 4 years ago

It seems like the component always uses the same identifier:

(this.$route.path || window.location.pathname)

Our project uses localization via nuxt-i18n/vue-i18n so the path will differ for different languages. We'd like to have the same comment thread for any locale.

It would be nice to be able to override identifier in the component

ktquez commented 4 years ago

Sorry for delay.

You can use the pageConfig prop, using the identifier property, for example:

<Disqus shortname='your_shortname_disqus' :pageConfig="{ identifier: 'yout_unique_identifier' }" />

let me know if it worked, okay?

Thanks,

neel commented 4 years ago

I am getting

There was a problem with the Disqus configuration. TypeError: Cannot read property 'path' of undefined

near this.$route.path

Can this be ((this.$route && this.$route.path) || window.location.pathname) ? Because It forces to use vue-router

bbedward commented 4 years ago

Thanks @ktquez that seems to work fine