how to reload utterance comment when title change
toughhyeok opened this issue · comments
hello. I'm using Vue.js to dynamically change document.title
. When document.title
is changed, how can I automatically reload to the issue that matches the title?
...
mounted() {
console.log("mounted()...");
let script = document.createElement("script");
script.setAttribute("src", "https://utteranc.es/client.js");
script.setAttribute("issue-term", "title");
script.setAttribute("repo", $repo);
script.setAttribute("theme", "github-light");
script.setAttribute("crossorigin", "anonymous");
script.setAttribute("async", true);
const element = document.getElementById("utte-comment");
element.appendChild(script);
},
...
...
axios.get(`/api/post/${postId}/`)
.then(res => {
console.log("FETCH POSTDETAIL GET RES", res);
this.post = res.data.post;
this.prevPost = res.data.prevPost;
this.nextPost = res.data.nextPost;
document.title = this.post.title;
})
...