vuepress-plugin-twikoo 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Comment.vue +4 -4
- package/package.json +1 -1
package/Comment.vue
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
<script>
|
|
6
6
|
export default {
|
|
7
|
-
mounted
|
|
7
|
+
mounted() {
|
|
8
8
|
// 检查是否在浏览器环境中
|
|
9
9
|
if (typeof window !== 'undefined') {
|
|
10
10
|
this.initTwikoo()
|
|
@@ -21,7 +21,7 @@ export default {
|
|
|
21
21
|
})
|
|
22
22
|
},
|
|
23
23
|
methods: {
|
|
24
|
-
async initTwikoo
|
|
24
|
+
async initTwikoo() {
|
|
25
25
|
const frontmatter = {
|
|
26
26
|
to: {},
|
|
27
27
|
from: {},
|
|
@@ -35,10 +35,10 @@ export default {
|
|
|
35
35
|
const twikoo = await import('twikoo')
|
|
36
36
|
twikoo.init({
|
|
37
37
|
...TWIKOO_OPTIONS,
|
|
38
|
-
el: '#tcomment'
|
|
38
|
+
el: TWIKOO_CONTAINER || '#tcomment'
|
|
39
39
|
})
|
|
40
40
|
},
|
|
41
|
-
needComment
|
|
41
|
+
needComment(frontmatter) {
|
|
42
42
|
return frontmatter.comment !== false && frontmatter.comments !== false
|
|
43
43
|
}
|
|
44
44
|
}
|