提交 7083fa8b 编写于 作者: D DebugIsFalse

add fetch

上级 2de6467c
......@@ -31,6 +31,7 @@
</div>
</template>
<script setup>
const { $setRepo } = useReposStore()
const { fetchRequest } = useFetchRequest()
const emits = defineEmits([ 'search' ])
const query = ref('')
......@@ -67,6 +68,7 @@ repos.value = repoData.data.map(item => {
branch: item.branch
}
})
$setRepo(repos.value)
defineShortcuts({
meta_enter: {
......
......@@ -62,12 +62,11 @@ const isAutoToBottom = ref(true)
const handleScroll = (event, params) => {
// 在asking操作的时候生效
if (!asking.value || !isAutoToBottom.value) return
nextTick(() => {
const top = window.scrollY;
if (top < y.value) {
isAutoToBottom.value = false
}
})
const top = window.scrollY;
console.log('y.value:', top, y.value)
if (top < y.value) {
isAutoToBottom.value = false
}
}
const scrollToView = () => {
if (!isAutoToBottom.value) return
......@@ -133,7 +132,7 @@ const handleFormFetchData = (fetchData) => {
if (Object.keys(message).length === 0) return
const { meta, choices } = message
const index = editIndex.value
nextTick(() => {
setTimeout(() => {
scrollToView()
})
// 处理报错信息
......
import { defineStore } from 'pinia'
export const useReposStore = defineStore('repos', () => {
const $repos = ref([])
function $setRepo (data) {
$repos.value = data || []
}
return { $repos, $setRepo }
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册