diff --git a/pages/search/[id].vue b/pages/search/[id].vue index 8027d1b08a6e56872597785341a6df09053da571..cb4ceb27a6b2ee97123dae0fd7ba9b3a58351894 100644 --- a/pages/search/[id].vue +++ b/pages/search/[id].vue @@ -242,6 +242,9 @@ const handleFormFetchData = (fetchData) => { if (Object.keys(message).length === 0) return; const { meta, choices } = message; const index = editIndex.value; + nextTick(() => { + scrollToView(); + }) if (meta.type === 'answer') { Object.assign(data.value[index], { ansLoading: true, @@ -261,9 +264,6 @@ const handleFormFetchData = (fetchData) => { let source = choices[0].message.content; storeSource = source.split('\n'); } - nextTick(() => { - scrollToView(); - }) } const handleUpdateSource = () => { const index = editIndex.value; @@ -274,7 +274,7 @@ const handleUpdateSource = () => { storeSource = storeSource.map((item) => { return { repo: state.repo, - link: `${baseUrl}/blob/${state.branch}/${item.label}`, + link: `${baseUrl}/blob/${state.branch}/${item}`, label: item } }) @@ -301,7 +301,6 @@ const handleStopGenerate = () => { asking.value = false; } const handleError = (event) => { - console.log(`error`, event) handleStopGenerate(); } const generateFetchData = (query) => {