提交 876a6bce 编写于 作者: View Design's avatar View Design

Update [id].vue

上级 248eb798
......@@ -35,14 +35,29 @@
</div>
</template>
<script setup>
const { $setRepo, $repos } = useReposStore()
const toast = useToast()
const route = useRoute()
const { fetchRequest } = useFetchRequest()
const repos = getMockRepo()
const editIndex = ref(0)
const { y } = useWindowScroll({ behavior: 'smooth' })
let repoData = await fetchRequest('/v1/chat/repository', {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
repoData = repoData.data.map(item => {
return {
label: item.name,
url: item.path,
branch: item.branch
}
})
$setRepo(repoData)
// todo mock
const repoItem = repos.find(item => route.query.repo === item.label)
const repoItem = $repos.find(item => route.query.repo === item.label)
const state = reactive({
query: route.query.query || '',
repo: route.query.repo || '',
......@@ -63,7 +78,6 @@ const handleScroll = (event, params) => {
// 在asking操作的时候生效
if (!asking.value || !isAutoToBottom.value) return
const top = window.scrollY;
console.log('y.value:', top, y.value)
if (top < y.value) {
isAutoToBottom.value = false
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册