ai-chat-bot-interface 1.4.3 → 1.4.5
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 +1 -1
- package/src/App.vue +2 -2
- package/src/components/OperateModule.vue +17 -0
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -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,18 @@ const resizeTextarea = () => {
|
|
|
320
325
|
}
|
|
321
326
|
});
|
|
322
327
|
};
|
|
328
|
+
|
|
329
|
+
const handleFocus = () => {
|
|
330
|
+
nextTick(() => {
|
|
331
|
+
window.scrollTo({
|
|
332
|
+
top: Math.round(
|
|
333
|
+
0.7 * window.innerHeight + 0.5476 * window.innerWidth - 416.4,
|
|
334
|
+
), // 滚动到页面的总高度
|
|
335
|
+
behavior: 'smooth', // 平滑滚动效果
|
|
336
|
+
});
|
|
337
|
+
});
|
|
338
|
+
};
|
|
339
|
+
const handleBlur = () => {};
|
|
323
340
|
</script>
|
|
324
341
|
|
|
325
342
|
<style scoped lang="less">
|