|
@@ -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" />
|
|
@@ -29,6 +29,7 @@
|
|
|
autosize
|
|
|
placeholder="请输入您的问题"
|
|
|
type="textarea"
|
|
|
+ @focus="focus"
|
|
|
>
|
|
|
<template #button>
|
|
|
<van-button
|
|
@@ -129,6 +130,12 @@ function saveText() {
|
|
|
load.value = false;
|
|
|
});
|
|
|
}
|
|
|
+function focus(){
|
|
|
+ let t = setTimeout(() => {
|
|
|
+ document.getElementById("van-field-6-input") && document.getElementById("van-field-6-input").scrollIntoView();
|
|
|
+ window.clearTimeout(t);
|
|
|
+ }, 200);
|
|
|
+}
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
.chatGptChat {
|