ai-chat-bot-interface 1.6.11 → 1.6.12

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ai-chat-bot-interface",
3
3
  "private": false,
4
- "version": "1.6.11",
4
+ "version": "1.6.12",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "description": "A AI chat bot interface. (private)",
@@ -119,9 +119,13 @@ const contentRef = ref(null); // 用于引用内容 DOM 元素
119
119
  const contentHeight = ref(0); // 存储内容的实际高度
120
120
 
121
121
  onMounted(() => {
122
- contentHeight.value = hasDetails.value ? contentRef.value.scrollHeight : 0;
122
+ getContentHeight();
123
123
  });
124
124
 
125
+ const getContentHeight = () => {
126
+ contentHeight.value = hasDetails.value ? contentRef.value.scrollHeight : 0;
127
+ };
128
+
125
129
  // const Emits = defineEmits(['update:open']);
126
130
 
127
131
  const subStr = computed(() => {
@@ -151,6 +155,9 @@ const previewImg = (url) => {
151
155
  };
152
156
 
153
157
  const switchOpen = () => {
158
+ if (!isOpen.value) {
159
+ getContentHeight();
160
+ }
154
161
  isOpen.value = !isOpen.value;
155
162
  };
156
163