utterances
utterances copied to clipboard
Any chances to have this working as a vue component?
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?
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>
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!