ai-chat-bot-interface 1.4.3 → 1.4.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ai-chat-bot-interface",
3
3
  "private": false,
4
- "version": "1.4.3",
4
+ "version": "1.4.4",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "description": "A AI chat bot interface. (private)",
@@ -55,6 +55,8 @@
55
55
  :placeholder="defMsg.placeholder"
56
56
  @input="handleInput"
57
57
  @keyup.enter="sendMsg"
58
+ @focus="handleFocus"
59
+ @blur="handleBlur"
58
60
  />
59
61
  <div class="btn_group">
60
62
  <div class="btn" @click.stop="sendMsg">
@@ -193,6 +195,9 @@ const handleTag = (info) => {
193
195
  }
194
196
  };
195
197
  const sendMsg = () => {
198
+ if (!textValue.value) {
199
+ return;
200
+ }
196
201
  if (
197
202
  uFileList.value.length &&
198
203
  uFileList.value.findIndex((f) => f.percent < 100) > -1
@@ -320,6 +325,16 @@ const resizeTextarea = () => {
320
325
  }
321
326
  });
322
327
  };
328
+
329
+ const handleFocus = () => {
330
+ nextTick(() => {
331
+ window.scrollTo({
332
+ top: Math.round((53 * window.innerHeight) / window.innerWidth + 300), // 滚动到页面的总高度
333
+ behavior: 'smooth', // 平滑滚动效果
334
+ });
335
+ });
336
+ };
337
+ const handleBlur = () => {};
323
338
  </script>
324
339
 
325
340
  <style scoped lang="less">