File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 1
1
<script setup lang='ts'>
2
+ import type { Ref } from ' vue'
2
3
import { computed , onMounted , onUnmounted , ref } from ' vue'
3
4
import { useRoute } from ' vue-router'
4
5
import { storeToRefs } from ' pinia'
@@ -40,6 +41,7 @@ const conversationList = computed(() => dataSources.value.filter(item => (!item.
40
41
41
42
const prompt = ref <string >(' ' )
42
43
const loading = ref <boolean >(false )
44
+ const inputRef = ref <Ref | null >(null )
43
45
44
46
// 添加PromptStore
45
47
const promptStore = usePromptStore ()
@@ -452,6 +454,8 @@ const footerClass = computed(() => {
452
454
453
455
onMounted (() => {
454
456
scrollToBottom ()
457
+ if (inputRef .value )
458
+ inputRef .value ?.focus ()
455
459
})
456
460
457
461
onUnmounted (() => {
@@ -532,6 +536,7 @@ onUnmounted(() => {
532
536
<NAutoComplete v-model:value =" prompt" :options =" searchOptions" :render-label =" renderOption" >
533
537
<template #default =" { handleInput , handleBlur , handleFocus } " >
534
538
<NInput
539
+ ref =" inputRef"
535
540
v-model:value =" prompt"
536
541
type =" textarea"
537
542
:placeholder =" placeholder"
You can’t perform that action at this time.
0 commit comments