提交 2b35e309 编写于 作者: D DebugIsFalse

Merge branch 'main' of gitcode.com:git_bot/ai-fe

<template>
<component :is="titleTag" :class="{ 'text-3xl': titleTag !== 'div' }" :id="id">{{ title }}</component>
</template>
<script setup>
const props = defineProps({
as: {
type: String,
default: 'h2'
},
title: {
type: String,
default: ''
},
id: {
type: [String, Number],
default: ''
}
})
const titleTag = computed(() => {
let tag = props.as
const title = props.title
if (title.indexOf('\n') > -1) tag = 'div'
else if (title.length > 50) tag = 'div'
return tag
})
</script>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<iSearchHeader ref="refHeader" :query="state.title" :is-public="state.isPublic" @update-query="handleUpdateQuery" /> <iSearchHeader ref="refHeader" :query="state.title" :is-public="state.isPublic" @update-query="handleUpdateQuery" />
<div class="container min-h-svh max-w-screen-lg flex flex-col space-y-6 p-6 mb-6 pb-0" id="scrollElement"> <div class="container min-h-svh max-w-screen-lg flex flex-col space-y-6 p-6 mb-6 pb-0" id="scrollElement">
<div class="grid"> <div class="grid">
<h1 class="text-3xl">{{ state.query }}</h1> <ISearchTitle as="h1" :title="state.query" />
</div> </div>
<section class="flex items-center gap-2" v-if="state.repo"> <section class="flex items-center gap-2" v-if="state.repo">
<UIcon name="i-simple-icons-github" /> <UIcon name="i-simple-icons-github" />
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</section> </section>
<template v-for="(item, index) in data" :key="index"> <template v-for="(item, index) in data" :key="index">
<div class="grid" v-if="index !== 0"> <div class="grid" v-if="index !== 0">
<h2 class="text-3xl" :id="index + 1">{{ item.question }}</h2> <ISearchTitle as="h2" :title="item.question" :id="index + 1" />
</div> </div>
<ISearchContent <ISearchContent
:item="item" :item="item"
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<UDivider v-if="data.length !== index + 1 || askingData.question" class="pt-3 pb-2" /> <UDivider v-if="data.length !== index + 1 || askingData.question" class="pt-3 pb-2" />
</template> </template>
<div class="grid" v-if="data.length > 0 && askingData.question"> <div class="grid" v-if="data.length > 0 && askingData.question">
<h2 class="text-3xl" :id="data.length + 1">{{ askingData.question }}</h2> <ISearchTitle as="h2" :title="askingData.question" :id="data.length + 1" />
</div> </div>
<ISearchContent <ISearchContent
v-if="askingData.question" v-if="askingData.question"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册