|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div :class="{ chatGptChat: true, ortherP: !userData.UserId }" ref="chatEle" >
|
|
|
+ <div :class="{ chatGptChat: true, ortherP: !userData.UserId }" ref="chatEle">
|
|
|
<div v-for="(item, index) in chat" :key="index">
|
|
|
<div v-if="item.text && item.type === 'robot'" class="chat">
|
|
|
<van-image width="35px" height="35px" fit="contain" :src="robot" />
|
|
@@ -134,13 +134,11 @@ function saveText() {
|
|
|
});
|
|
|
}
|
|
|
function focus() {
|
|
|
- let t = window.setTimeout(() => {
|
|
|
- window.clearTimeout(t);
|
|
|
- if (chatEle.value.scrollHeight > chatEle.value.clientHeight) {
|
|
|
- chatEle.value.scrollTop = chatEle.value.scrollHeight;
|
|
|
- }
|
|
|
- document.getElementById("van-field-6-input") && document.getElementById("van-field-6-input").scrollIntoView();
|
|
|
- }, 1000);
|
|
|
+ if (chatEle.value.scrollHeight > chatEle.value.clientHeight) {
|
|
|
+ chatEle.value.scrollTop = chatEle.value.scrollHeight;
|
|
|
+ }
|
|
|
+ document.getElementById('van-field-6-input') &&
|
|
|
+ document.getElementById('van-field-6-input').scrollIntoView();
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss">
|