vuepress-plugin-twikoo 1.0.3 → 1.0.4
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 +8 -3
- package/package.json +1 -1
package/Comment.vue
CHANGED
|
@@ -8,7 +8,8 @@ export default {
|
|
|
8
8
|
// 检查是否在浏览器环境中
|
|
9
9
|
if (typeof window !== 'undefined') {
|
|
10
10
|
// 如果指定了容器,将评论组件移动到指定位置
|
|
11
|
-
this
|
|
11
|
+
this.$nextTick(() => {
|
|
12
|
+
// 这里操作 DOM 更安全,能确保组件相关的 DOM 全部渲染
|
|
12
13
|
this.moveContainer()
|
|
13
14
|
this.initTwikoo()
|
|
14
15
|
})
|
|
@@ -21,11 +22,15 @@ export default {
|
|
|
21
22
|
// 检查是否在浏览器环境中
|
|
22
23
|
if (typeof window !== 'undefined') {
|
|
23
24
|
// 重新定位评论组件
|
|
24
|
-
this
|
|
25
|
-
|
|
25
|
+
this.$nextTick(() => {
|
|
26
|
+
// 这里操作 DOM 更安全,能确保组件相关的 DOM 全部渲染
|
|
27
|
+
this.moveContainer()
|
|
28
|
+
this.initTwikoo()
|
|
29
|
+
})
|
|
26
30
|
}
|
|
27
31
|
})
|
|
28
32
|
},
|
|
33
|
+
|
|
29
34
|
methods: {
|
|
30
35
|
async initTwikoo() {
|
|
31
36
|
const frontmatter = {
|