提交 bf71f697 编写于 作者: D DebugIsFalse

fix: 添加scrollTo功能

上级 02d7f029
...@@ -242,6 +242,9 @@ const handleFormFetchData = (fetchData) => { ...@@ -242,6 +242,9 @@ const handleFormFetchData = (fetchData) => {
if (Object.keys(message).length === 0) return; if (Object.keys(message).length === 0) return;
const { meta, choices } = message; const { meta, choices } = message;
const index = editIndex.value; const index = editIndex.value;
nextTick(() => {
scrollToView();
})
if (meta.type === 'answer') { if (meta.type === 'answer') {
Object.assign(data.value[index], { Object.assign(data.value[index], {
ansLoading: true, ansLoading: true,
...@@ -261,9 +264,6 @@ const handleFormFetchData = (fetchData) => { ...@@ -261,9 +264,6 @@ const handleFormFetchData = (fetchData) => {
let source = choices[0].message.content; let source = choices[0].message.content;
storeSource = source.split('\n'); storeSource = source.split('\n');
} }
nextTick(() => {
scrollToView();
})
} }
const handleUpdateSource = () => { const handleUpdateSource = () => {
const index = editIndex.value; const index = editIndex.value;
...@@ -274,7 +274,7 @@ const handleUpdateSource = () => { ...@@ -274,7 +274,7 @@ const handleUpdateSource = () => {
storeSource = storeSource.map((item) => { storeSource = storeSource.map((item) => {
return { return {
repo: state.repo, repo: state.repo,
link: `${baseUrl}/blob/${state.branch}/${item.label}`, link: `${baseUrl}/blob/${state.branch}/${item}`,
label: item label: item
} }
}) })
...@@ -301,7 +301,6 @@ const handleStopGenerate = () => { ...@@ -301,7 +301,6 @@ const handleStopGenerate = () => {
asking.value = false; asking.value = false;
} }
const handleError = (event) => { const handleError = (event) => {
console.log(`error`, event)
handleStopGenerate(); handleStopGenerate();
} }
const generateFetchData = (query) => { const generateFetchData = (query) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册