Skip to content

Commit

Permalink
[Add] twikoo comment
Browse files Browse the repository at this point in the history
  • Loading branch information
JunyaoHu committed Jan 11, 2024
1 parent 14d3d1e commit 75b1421
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
<script src="https://cdn.staticfile.org/twikoo/1.6.29/twikoo.all.min.js"></script>
</body>
</html>
3 changes: 3 additions & 0 deletions src/components/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Carousel from './sections/Carousel.vue'
import Video from './sections/Video.vue'
import ImageSlider from './sections/ImageSlider.vue'
import Echart from './sections/Echart.vue'
import Comment from './sections/Comment.vue'
export default {
components: {
Expand All @@ -16,6 +17,7 @@ export default {
Video,
ImageSlider,
Echart,
Comment,
}
}
</script>
Expand All @@ -28,4 +30,5 @@ export default {
<Echart/>
<ImageSlider/>
<BibTeX/>
<Comment/>
</template>
22 changes: 22 additions & 0 deletions src/components/sections/Comment.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<script>
twikoo.init({
envId: 'https://blog-comment-h866w5ycd-junyaohu.vercel.app/', // 腾讯云环境填 envId;Vercel 环境填地址(https://xxx.vercel.app)
el: '#tcomment', // 容器元素
region: 'ap-shanghai', // 环境地域,默认为 ap-shanghai,腾讯云环境填 ap-shanghai 或 ap-guangzhou;Vercel 环境不填
path: window.location.pathname, // 用于区分不同文章的自定义 js 路径,如果您的文章路径不是 location.pathname,需传此参数
lang: 'zh-CN', // 用于手动设定评论区语言,支持的语言列表 https://github.com/twikoojs/twikoo/blob/main/src/client/utils/i18n/index.js
})
</script>

<template>
<div>
<el-row>
<h1 class="title1">Comment</h1>
</el-row>
<el-row>
<el-col class='bibtex' :span="20">
<div id="tcomment"></div>
</el-col>
</el-row>
</div>
</template>

0 comments on commit 75b1421

Please sign in to comment.