diff --git a/pages/search/[id].vue b/pages/search/[id].vue
index fac2621adb90325eed642cd2303d510f20e10b3a..23c2735654a8bf255c22b32b68abd64f9989ea55 100644
--- a/pages/search/[id].vue
+++ b/pages/search/[id].vue
@@ -22,11 +22,11 @@
/>
-
+
{{ askingData.question }}
{
- let { answer, actions } = item
- const historyItem = { article: answer, desLoading: false, searchLoading: false, ansLoading: false }
- // console.log(`actions:`, typeof actions)
+ let { answer, actions, question } = item
+ const historyItem = { article: answer, question, desLoading: false, searchLoading: false, ansLoading: false}
// todo ?action为啥成了string?
actions = typeof actions === 'string' ? JSON.parse(actions) : actions
// console.log(actions)
@@ -142,7 +141,9 @@ const handleCloseHistoryAsk = () => {
})
}
const createGenerateInitItem = (question) => {
- data.value.push(askingData.value)
+ if (askingData.value.question) {
+ data.value.push(askingData.value)
+ }
nextTick(() => {
handleCloseHistoryAsk()
askingData.value = { question, desLoading: true }
@@ -151,8 +152,10 @@ const createGenerateInitItem = (question) => {
const handleContinueAsk = (question) => {
if (asking.value) return
asking.value = true
- askingRef.value.handleCollapse(true)
createGenerateInitItem(question)
+ nextTick(() => {
+ askingRef.value && askingRef.value.handleCollapse(true)
+ })
generateFetchData(question)
setTimeout(() => {
scrollToView()
@@ -282,7 +285,8 @@ onMounted( () => {
if (data.value.length === 0 && state.query) {
generateFetchData(state.query)
} else {
-
+ asking.value = false;
+ askingData.value = {}
}
})