utterances icon indicating copy to clipboard operation
utterances copied to clipboard

Any chances to have this working as a vue component?

Open robertgarrigos opened this issue 5 years ago • 2 comments

I don't know how to do this (yet), but it would be nice to make it work as a vue component. Has anyone done it successfully with the latest version of the script?

robertgarrigos avatar May 03 '20 17:05 robertgarrigos

I think this is just a work around, but it works.

<template>
  <div>
    <section class="mb-40" ref="utteranc-comments-element"></section>
  </div>
</template>



<script>
export default {
  name: 'blog-index',

  mounted() {
    let utterancScript = document.createElement('script');
  
    utterancScript.setAttribute('src', 'https://utteranc.es/client.js');
    utterancScript.setAttribute('repo', 'abdelaziz321/abdelaziz321.github.io');
    utterancScript.setAttribute('issue-term', 'pathname');
    utterancScript.setAttribute('label', 'Comments');
    utterancScript.setAttribute('theme', 'github-light');
    utterancScript.setAttribute('crossorigin', 'anonymous');
    utterancScript.setAttribute('async', true);

    this.$refs['utteranc-comments-element'].appendChild(utterancScript);
  }
}
</script>

abdelaziz321 avatar Nov 29 '20 22:11 abdelaziz321

Saw this issue and decided to make this:

https://github.com/khalby786/vue-utterances

Would appreciate it if you could star the repo if it helps!

khalby786 avatar Mar 26 '21 16:03 khalby786