vuepress-plugin-twikoo 1.0.6 → 1.0.7

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.
Files changed (2) hide show
  1. package/Comment.vue +4 -3
  2. package/package.json +1 -1
package/Comment.vue CHANGED
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div></div>
2
+ <div id="twikoo"></div>
3
3
  </template>
4
4
 
5
5
  <script>
@@ -43,7 +43,8 @@ export default {
43
43
  const twikoo = await import('twikoo');
44
44
  // 初始化后返回 Promise,确保 DOM 生成完成
45
45
  await twikoo.init({
46
- ...TWIKOO_OPTIONS
46
+ ...TWIKOO_OPTIONS,
47
+ el: TWIKOO_OPTIONS.el || '#twikoo'
47
48
  });
48
49
 
49
50
  this.moveContainerWithRetry();
@@ -60,7 +61,7 @@ export default {
60
61
  const targetContainer = document.querySelector(TWIKOO_CONTAINER);
61
62
  if (!targetContainer) return; // 目标容器不存在则返回
62
63
 
63
- const commentContainer = document.querySelector('#twikoo');
64
+ const commentContainer = document.querySelector(TWIKOO_OPTIONS.el || '#twikoo');
64
65
  if (commentContainer) {
65
66
  targetContainer.appendChild(commentContainer);
66
67
  return true; // 移动成功,返回 true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vuepress-plugin-twikoo",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Twikoo comment plugin for vuepress 1.x",
5
5
  "main": "index.js",
6
6
  "scripts": {