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

更新来源

上级 02d7f029
<template>
<ULink v-for="(item, index) in limitSource" :to="item.link" :title="item.link" target="_blank">
<UCard :ui="cardUI">
<div class="flex flex-col gap-1">
<div class="items-center flex gap-1">
<UIcon name="i-simple-icons-github" />
<div class="truncate flex flex-grow">{{ item.repo }}</div>
<div class="text-gray-200">{{ index + 1 }}</div>
</div>
<div class="text-blue-500 truncate">{{ item.label }}</div>
</div>
</UCard>
</ULink>
<UCard class="cursor-pointer" :ui="cardUI" v-if="source.length > 6" @click="handleToggleShowAll">
<div class="flex items-center justify-center h-full gap-1">
<UIcon name="i-heroicons-link-20-solid" />
<div v-if="!showAllSource">查看全部{{ source.length }}个来源</div>
<div v-else>收起</div>
</div>
</UCard>
</template>
<script setup>
const props = defineProps({
source: {
type: Array,
default: () => []
}
})
const cardUI = {
body: {
padding: 'sm:p-3 p-3',
base: 'h-full'
}
}
const showAllSource = ref(false)
const limitSource = computed(() => {
if (props.source.length <= 6) return props.source
else if (showAllSource.value) return props.source
else return props.source.slice(0, 5)
})
const handleToggleShowAll = () => {
showAllSource.value = !showAllSource.value
}
</script>
...@@ -3717,8 +3717,6 @@ ...@@ -3717,8 +3717,6 @@
}, },
"node_modules/@parcel/watcher-wasm/node_modules/napi-wasm": { "node_modules/@parcel/watcher-wasm/node_modules/napi-wasm": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmmirror.com/napi-wasm/-/napi-wasm-1.1.0.tgz",
"integrity": "sha512-lHwIAJbmLSjF9VDRm9GoVOy9AGp3aIvkjv+Kvz9h16QR3uSVYH78PNQUnT2U4X53mhlnV2M7wrhibQ3GHicDmg==",
"inBundle": true, "inBundle": true,
"license": "MIT" "license": "MIT"
}, },
...@@ -17780,8 +17778,6 @@ ...@@ -17780,8 +17778,6 @@
"dependencies": { "dependencies": {
"napi-wasm": { "napi-wasm": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmmirror.com/napi-wasm/-/napi-wasm-1.1.0.tgz",
"integrity": "sha512-lHwIAJbmLSjF9VDRm9GoVOy9AGp3aIvkjv+Kvz9h16QR3uSVYH78PNQUnT2U4X53mhlnV2M7wrhibQ3GHicDmg==",
"bundled": true "bundled": true
} }
} }
......
...@@ -76,17 +76,7 @@ ...@@ -76,17 +76,7 @@
<span>来源</span> <span>来源</span>
</div> </div>
<div class="grid grid-cols-1 lg:grid-cols-3 gap-4"> <div class="grid grid-cols-1 lg:grid-cols-3 gap-4">
<ULink v-for="(source, sourceIndex) in item.source" :to="source.link" target="_blank"> <ISearchSource :source="item.source" />
<UCard :ui="{ body: { padding: 'sm:p-3 p-3' } }">
<div class="flex flex-col space-y-1">
<div class="justify-between flex space-x-1">
<span class="truncate"><UIcon class="mr-1" name="i-simple-icons-github" />{{ source.repo }}</span>
<span class="text-gray-200">{{ sourceIndex + 1 }}</span>
</div>
<div class="text-blue-500 truncate">{{ source.label }}</div>
</div>
</UCard>
</ULink>
</div> </div>
<UDivider v-if="index !== data.length - 1" class="pt-2 pb-2" /> <UDivider v-if="index !== data.length - 1" class="pt-2 pb-2" />
</template> </template>
...@@ -197,8 +187,6 @@ const handleReGenerate = (index) => { ...@@ -197,8 +187,6 @@ const handleReGenerate = (index) => {
}) })
} }
const steps = ['', '问题分析', '代码搜索', '整理答案', '完成!']
const data = ref([]) const data = ref([])
const recommendQuestions = [ const recommendQuestions = [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册