ktquez / vue-disqus

Integrate Disqus count and comments in your application Vue 3, with support for SPA

Home Page:https://ktquez.github.io/vue-disqus/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use `reset` in Vue 3 script setup

mrleblanc101 opened this issue · comments

I see you provide app.provide(Symbol('disqus'), disqusConfig), but since you don't export the symbol, we cannot import it to use for the inject. See the documentation here: https://vuejs.org/guide/components/provide-inject.html#working-with-symbol-keys

@ktquez Had any chance to look into this ?

Found an alternative, just use a dynamic key with the colorMode as the value which reload the component completely on change forcing the init function to rerun.

<ClientOnly>
    <Disqus class="mt-8" :key="colorMode.value" />
</ClientOnly>

Hello @mrleblanc101, how are you?

I'll take a look and as soon as I publish a new version, I'll let you know here.

@ktquez It's all good, I think we could simply document my solution in the README for Vue 3, don't need to change anything

@mrleblanc101 you are a godsend my man. :key still fixes reload issue.