@@ -5,18 +5,20 @@ import { Close } from '@element-plus/icons-vue'
55import RecommendQuestion from ' @/views/chat/RecommendQuestion.vue'
66import { ChatInfo } from ' @/api/chat.ts'
77import RecentQuestion from ' @/views/chat/RecentQuestion.vue'
8- const visible = ref (false )
98const activeName = ref (' recommend' )
109const recommendQuestionRef = ref ()
11-
10+ const popoverRef = ref ()
1211const getRecommendQuestions = () => {
1312 recommendQuestionRef .value .getRecommendQuestions ()
1413}
1514const quickAsk = (question : string ) => {
1615 emits (' quickAsk' , question )
17- visible . value = false
16+ hiddenProps ()
1817}
1918
19+ const hiddenProps = () => {
20+ popoverRef .value .hide ()
21+ }
2022const onChatStop = () => {
2123 emits (' stop' )
2224}
@@ -50,13 +52,14 @@ const props = withDefaults(
5052
5153<template >
5254 <el-popover
55+ ref =" popoverRef"
5356 :title =" $t('qa.quick_question')"
54- :visible =" visible"
5557 popper-class =" quick_question_popover"
5658 placement =" top-start"
59+ trigger =" click"
5760 :width =" 320"
5861 >
59- <el-icon class =" close_icon" ><Close @click =" visible = false " /></el-icon >
62+ <el-icon class =" close_icon" ><Close @click =" hiddenProps " /></el-icon >
6063 <el-tabs v-model =" activeName" class =" quick_question_tab" >
6164 <el-tab-pane :label =" $t('qa.recommend')" name =" recommend" >
6265 <RecommendQuestion
@@ -73,12 +76,11 @@ const props = withDefaults(
7376 />
7477 </el-tab-pane >
7578 <el-tab-pane v-if =" datasourceId" :label =" $t('qa.recently')" name =" recently" >
76- <RecentQuestion v-if =" visible" :datasource-id =" datasourceId" @click-question =" quickAsk" >
77- </RecentQuestion >
79+ <RecentQuestion :datasource-id =" datasourceId" @click-question =" quickAsk" > </RecentQuestion >
7880 </el-tab-pane >
7981 </el-tabs >
8082 <template #reference >
81- <el-button plain size =" small" @click = " visible = true " >
83+ <el-button plain size =" small" >
8284 <el-icon size =" 16" class =" el-icon--left" >
8385 <icon _quick_question />
8486 </el-icon >
0 commit comments