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

eslint: vue template space

上级 dfa4925c
<template>
<NuxtPwaManifest />
<NuxtLoadingIndicator />
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
<UNotifications />
<UModals />
<NuxtPwaManifest/>
<NuxtLoadingIndicator/>
<NuxtLayout>
<NuxtPage/>
</NuxtLayout>
<UNotifications/>
<UModals/>
</template>
<script setup>
const { $updateUserInfo } = useUserStore()
......
<template>
<UPopover :popper="{ strategy: 'absolute' }" :ui="{ width: 'w-[156px]' }">
<template #default="{ open }">
<UButton
<UPopover :popper="{ strategy: 'absolute' }" :ui="{ width: 'w-[156px]' }">
<template #default="{ open }">
<UButton
color="gray"
variant="ghost"
square
:class="[open && 'bg-gray-50 dark:bg-gray-800']"
icon="i-heroicons-swatch-16-solid"
:ui="{ icon: { base: 'text-primary-500 dark:text-primary-400' } }"
aria-label="Color picker"
/>
</template>
<template #panel>
<div class="flex flex-col p-2 gap-2">
<div class="grid grid-cols-5 gap-px">
<ColorPickerPill v-for="color in primaryColors" :key="color.value" :color="color" :selected="primary" @select="primary = color" />
</div>
<UDivider />
<div class="grid grid-cols-5 gap-px">
<ColorPickerPill v-for="color in grayColors" :key="color.value" :color="color" :selected="gray" @select="gray = color" />
</div>
</div>
</template>
</UPopover>
variant="ghost"
square
:class="[open && 'bg-gray-50 dark:bg-gray-800']"
icon="i-heroicons-swatch-16-solid"
:ui="{ icon: { base: 'text-primary-500 dark:text-primary-400' } }"
aria-label="Color picker"
/>
</template>
<template #panel>
<div class="flex flex-col p-2 gap-2">
<div class="grid grid-cols-5 gap-px">
<ColorPickerPill v-for="color in primaryColors" :key="color.value" :color="color" :selected="primary"
@select="primary = color"/>
</div>
<UDivider/>
<div class="grid grid-cols-5 gap-px">
<ColorPickerPill v-for="color in grayColors" :key="color.value" :color="color" :selected="gray"
@select="gray = color"/>
</div>
</div>
</template>
</UPopover>
</template>
<script setup lang="ts">
......
<template>
<div class="flex-grow overflow-hidden bg-gray-100 dark:bg-gray-900 border-r border-gray-200 dark:border-gray-800">
<div class="p-4 h-full flex flex-col">
<ILogo class="mt-2" />
<UButton
:ui="{ rounded: 'rounded-full' }"
class="flex w-full mt-6"
color="gray"
leading-icon="i-heroicons-plus-20-solid"
size="md"
@click="handleShowCreate"
>
<div class="flex flex-grow justify-between items-center">
<span>新主题</span>
<div v-if="$device.isDesktop" class="flex items-center gap-0.5">
<UKbd>{{ metaSymbol }}</UKbd>
<UKbd>K</UKbd>
</div>
</div>
</UButton>
<div class="flex flex-grow overflow-hidden mt-4">
<INav />
</div>
</div>
</div>
<UDivider />
<div class="bg-gray-100 dark:bg-gray-900 border-r border-gray-200 dark:border-gray-800 flex flex-col items-center justify-center">
<IUserInfo />
</div>
<UModal v-model="isOpenCreate" :ui="{ width: 'w-full sm:max-w-screen-md' }">
<ICreate @search="handleCloseCreate" />
</UModal>
<div class="flex-grow overflow-hidden bg-gray-100 dark:bg-gray-900 border-r border-gray-200 dark:border-gray-800">
<div class="p-4 h-full flex flex-col">
<ILogo class="mt-2"/>
<UButton
:ui="{ rounded: 'rounded-full' }"
class="flex w-full mt-6"
color="gray"
leading-icon="i-heroicons-plus-20-solid"
size="md"
@click="handleShowCreate"
>
<div class="flex flex-grow justify-between items-center">
<span>新主题</span>
<div v-if="$device.isDesktop" class="flex items-center gap-0.5">
<UKbd>{{ metaSymbol }}</UKbd>
<UKbd>K</UKbd>
</div>
</div>
</UButton>
<div class="flex flex-grow overflow-hidden mt-4">
<INav/>
</div>
</div>
</div>
<UDivider/>
<div
class="bg-gray-100 dark:bg-gray-900 border-r border-gray-200 dark:border-gray-800 flex flex-col items-center justify-center">
<IUserInfo/>
</div>
<UModal v-model="isOpenCreate" :ui="{ width: 'w-full sm:max-w-screen-md' }">
<ICreate @search="handleCloseCreate"/>
</UModal>
</template>
<script setup>
const { metaSymbol } = useShortcuts()
......
<template>
<Transition
@enter="onEnter"
@after-enter="onAfterEnter"
@before-leave="onBeforeLeave"
@leave="onLeave"
>
<div v-show="open" class="flex transition-[height] overflow-hidden"><slot /></div>
</Transition>
<Transition
@enter="onEnter"
@after-enter="onAfterEnter"
@before-leave="onBeforeLeave"
@leave="onLeave"
>
<div v-show="open" class="flex transition-[height] overflow-hidden">
<slot/>
</div>
</Transition>
</template>
<script setup>
defineProps({
......
<template>
<UModal :ui="{ width: 'w-96 sm:max-w-screen-md' }">
<div class="flex p-6 gap-4">
<div class="flex">
<div class="mx-auto flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-red-100">
<UIcon name="i-heroicons-exclamation-triangle" class="w-6 h-6 text-red-600" />
</div>
</div>
<div class="flex-grow flex flex-col">
<div class="text-base leading-6 text-gray-900 dark:text-gray-300 truncate">{{ title }}</div>
<div class="mt-2 text-sm text-gray-500">{{ description }}</div>
</div>
</div>
<div class="p-4 flex justify-end gap-2">
<UButton color="white" @click="handleCancel">取消</UButton>
<UButton color="red" @click="handleSuccess">确定</UButton>
</div>
</UModal>
<UModal :ui="{ width: 'w-96 sm:max-w-screen-md' }">
<div class="flex p-6 gap-4">
<div class="flex">
<div class="mx-auto flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-red-100">
<UIcon name="i-heroicons-exclamation-triangle" class="w-6 h-6 text-red-600"/>
</div>
</div>
<div class="flex-grow flex flex-col">
<div class="text-base leading-6 text-gray-900 dark:text-gray-300 truncate">{{ title }}</div>
<div class="mt-2 text-sm text-gray-500">{{ description }}</div>
</div>
</div>
<div class="p-4 flex justify-end gap-2">
<UButton color="white" @click="handleCancel">取消</UButton>
<UButton color="red" @click="handleSuccess">确定</UButton>
</div>
</UModal>
</template>
<script setup>
defineProps({
......
<template>
<div class="flex justify-center">
<NuxtLink to="/" class="font-mono text-2xl font-medium">GitBot.<span class="text-primary">AI</span></NuxtLink>
</div>
<div class="flex justify-center">
<NuxtLink to="/" class="font-mono text-2xl font-medium">GitBot.<span class="text-primary">AI</span></NuxtLink>
</div>
</template>
\ No newline at end of file
<template>
<div class="flex md:hidden flex-shrink-0">
<UButton
class="z-20"
:class="{ 'fixed top-2 left-2' : fixed }"
color="white"
trailing-icon="i-heroicons-bars-3-20-solid"
@click="handleToggleAside"
/>
<USlideover
v-model="isOpenAside"
class="w-64"
side="left"
:overlay="false"
>
<UButton
class="absolute top-2 right-2 z-20"
color="white"
trailing-icon="i-heroicons-x-mark-20-solid"
@click="handleToggleAside"
/>
<IAside />
</USlideover>
</div>
<div class="flex md:hidden flex-shrink-0">
<UButton
class="z-20"
:class="{ 'fixed top-2 left-2' : fixed }"
color="white"
trailing-icon="i-heroicons-bars-3-20-solid"
@click="handleToggleAside"
/>
<USlideover
v-model="isOpenAside"
class="w-64"
side="left"
:overlay="false"
>
<UButton
class="absolute top-2 right-2 z-20"
color="white"
trailing-icon="i-heroicons-x-mark-20-solid"
@click="handleToggleAside"
/>
<IAside/>
</USlideover>
</div>
</template>
<script setup>
defineProps({
......
<template>
<div class="flex flex-col w-full gap-2">
<UButton
leading-icon="i-heroicons-home"
color="gray"
variant="ghost"
size="md"
label="首页"
to="/"
/>
<UButton
leading-icon="i-heroicons-rectangle-stack"
color="gray"
variant="ghost"
size="md"
label="主题"
to="/library"
/>
<ISearchHistory @sign="$openSign" />
<ClientOnly>
<UButton
v-if="!$isSignIn"
class="flex gap-2 justify-center"
size="lg"
label="登录"
@click="$openSign"
/>
</ClientOnly>
</div>
<UModal v-model="$isOpenSign">
<ISign @close="$closeSign" />
</UModal>
<div class="flex flex-col w-full gap-2">
<UButton
leading-icon="i-heroicons-home"
color="gray"
variant="ghost"
size="md"
label="首页"
to="/"
/>
<UButton
leading-icon="i-heroicons-rectangle-stack"
color="gray"
variant="ghost"
size="md"
label="主题"
to="/library"
/>
<ISearchHistory @sign="$openSign"/>
<ClientOnly>
<UButton
v-if="!$isSignIn"
class="flex gap-2 justify-center"
size="lg"
label="登录"
@click="$openSign"
/>
</ClientOnly>
</div>
<UModal v-model="$isOpenSign">
<ISign @close="$closeSign"/>
</UModal>
</template>
<script setup>
const { $isSignIn, $isOpenSign } = storeToRefs(useUserStore())
......
<template>
<div class="flex flex-col items-start gap-4 p-4">
<div class="flex w-full justify-between">
<ILogo />
<UButton
color="gray"
variant="ghost"
leading-icon="i-heroicons-x-mark-20-solid"
@click="handleClose"
/>
</div>
<div>登录以继续使用</div>
<UButton
block
color="gray"
size="md"
@click="handleGetSignUrl('gitcode')"
>
<img src="~/assets/svg/logo-gitcode.svg" >
使用 GitCode 登录
</UButton>
<UButton
block
leading-icon="i-simple-icons-github"
label="使用 GitHub 登录"
color="gray"
size="md"
@click="handleGetSignUrl('github')"
/>
<UButton
block
leading-icon="i-simple-icons-google"
label="使用 Google 登录"
color="gray"
size="md"
disabled
/>
<!-- <UDivider label="或" />-->
<!-- <UInput-->
<!-- class="w-full"-->
<!-- v-model="email"-->
<!-- placeholder="输入邮箱地址..."-->
<!-- size="md"-->
<!-- />-->
<!-- <UButton-->
<!-- block-->
<!-- leading-icon="i-heroicons-envelope-20-solid"-->
<!-- label="邮箱登录"-->
<!-- size="md"-->
<!-- @click="handleSign"-->
<!-- />-->
</div>
<div class="flex flex-col items-start gap-4 p-4">
<div class="flex w-full justify-between">
<ILogo/>
<UButton
color="gray"
variant="ghost"
leading-icon="i-heroicons-x-mark-20-solid"
@click="handleClose"
/>
</div>
<div>登录以继续使用</div>
<UButton
block
color="gray"
size="md"
@click="handleGetSignUrl('gitcode')"
>
<img src="~/assets/svg/logo-gitcode.svg">
使用 GitCode 登录
</UButton>
<UButton
block
leading-icon="i-simple-icons-github"
label="使用 GitHub 登录"
color="gray"
size="md"
@click="handleGetSignUrl('github')"
/>
<UButton
block
leading-icon="i-simple-icons-google"
label="使用 Google 登录"
color="gray"
size="md"
disabled
/>
<!-- <UDivider label="或" />-->
<!-- <UInput-->
<!-- class="w-full"-->
<!-- v-model="email"-->
<!-- placeholder="输入邮箱地址..."-->
<!-- size="md"-->
<!-- />-->
<!-- <UButton-->
<!-- block-->
<!-- leading-icon="i-heroicons-envelope-20-solid"-->
<!-- label="邮箱登录"-->
<!-- size="md"-->
<!-- @click="handleSign"-->
<!-- />-->
</div>
</template>
<script setup>
const emits = defineEmits(['close', 'signIn'])
......
<template>
<UDropdown class="flex flex-grow" :items="actionItems">
<UButton
color="gray"
variant="ghost"
:size="size"
square
icon="i-heroicons-ellipsis-horizontal"
/>
</UDropdown>
<UDropdown class="flex flex-grow" :items="actionItems">
<UButton
color="gray"
variant="ghost"
:size="size"
square
icon="i-heroicons-ellipsis-horizontal"
/>
</UDropdown>
</template>
<script setup>
import { IConfirm } from '#components'
......
<template>
<UModal
:model-value="!id ? $isLibraryCreateOpen : updateVisible"
:ui="{ width: 'w-96 sm:max-w-screen-md' }"
@update:model-value="handleCloseModal"
>
<UCard :ui="{ ring: '', divide: 'divide-y divide-gray-100 dark:divide-gray-800' }">
<template #header>
<div class="flex items-center justify-between">
<div v-if="!id" class="text-xl">创建合集</div>
<div v-else class="text-xl">更新合集</div>
<UButton
leading-icon="i-heroicons-x-mark-20-solid"
color="gray"
variant="ghost"
@click="handleClose"
/>
</div>
</template>
<div class="flex flex-col gap-6">
<div class="flex flex-col gap-1">
<div class="flex content-center items-center justify-between text-sm">
<label class="block font-medium text-gray-700 dark:text-gray-200">标题</label>
</div>
<UInput
v-model="title"
placeholder="合集标题"
autofocus
/>
</div>
<div class="flex flex-col gap-1">
<div class="flex content-center items-center justify-between text-sm">
<label class="block font-medium text-gray-700 dark:text-gray-200">
描述
<span class="text-gray-400 dark:text-gray-100">(可选)</span>
</label>
</div>
<UTextarea
v-model="description"
placeholder="合集描述"
/>
</div>
</div>
<template #footer>
<div class="flex justify-end">
<UButton
v-if="!id"
size="md"
label="创建"
:loading="loading"
:disabled="!title"
@click="handleCreate"
/>
<UButton
v-else
size="md"
label="更新"
:loading="loading"
:disabled="!title"
@click="handleUpdate"
/>
</div>
</template>
</UCard>
</UModal>
<UModal
:model-value="!id ? $isLibraryCreateOpen : updateVisible"
:ui="{ width: 'w-96 sm:max-w-screen-md' }"
@update:model-value="handleCloseModal"
>
<UCard :ui="{ ring: '', divide: 'divide-y divide-gray-100 dark:divide-gray-800' }">
<template #header>
<div class="flex items-center justify-between">
<div v-if="!id" class="text-xl">创建合集</div>
<div v-else class="text-xl">更新合集</div>
<UButton
leading-icon="i-heroicons-x-mark-20-solid"
color="gray"
variant="ghost"
@click="handleClose"
/>
</div>
</template>
<div class="flex flex-col gap-6">
<div class="flex flex-col gap-1">
<div class="flex content-center items-center justify-between text-sm">
<label class="block font-medium text-gray-700 dark:text-gray-200">标题</label>
</div>
<UInput
v-model="title"
placeholder="合集标题"
autofocus
/>
</div>
<div class="flex flex-col gap-1">
<div class="flex content-center items-center justify-between text-sm">
<label class="block font-medium text-gray-700 dark:text-gray-200">
描述
<span class="text-gray-400 dark:text-gray-100">(可选)</span>
</label>
</div>
<UTextarea
v-model="description"
placeholder="合集描述"
/>
</div>
</div>
<template #footer>
<div class="flex justify-end">
<UButton
v-if="!id"
size="md"
label="创建"
:loading="loading"
:disabled="!title"
@click="handleCreate"
/>
<UButton
v-else
size="md"
label="更新"
:loading="loading"
:disabled="!title"
@click="handleUpdate"
/>
</div>
</template>
</UCard>
</UModal>
</template>
<script setup>
const { $isLibraryCreateOpen, $collection } = storeToRefs(useLibraryStore())
......
<template>
<div class="flex flex-col w-full items-center sticky top-0 bg-white dark:bg-black z-10">
<div class="container max-w-screen-lg 2xl:max-w-screen-xl flex flex-col p-6">
<div class="flex justify-between items-center gap-4">
<div class="flex gap-4">
<IMenuSider />
<div v-if="!collect" class="flex flex-shrink-0 items-center text-xl gap-2">
<UIcon name="i-heroicons-rectangle-stack-20-solid" />
<div>主题</div>
</div>
<template v-else>
<UButton
icon="i-heroicons-chevron-left"
color="gray"
variant="ghost"
to="/library"
/>
<div class="flex items-center text-xl gap-2">
<UIcon name="i-heroicons-squares-2x2" />
<div>{{ collect }}</div>
<UBadge color="gray" variant="soft" :label="count" />
</div>
</template>
</div>
<div class="flex flex-grow justify-end items-center gap-4">
<div class="flex">
<IActionCollect v-if="collect" :id="collectId" />
</div>
<div v-if="!collect" class="flex">
<UInput
v-model="searchQuery"
name="queryInput"
:ui="{ icon: { trailing: { pointer: '' } } }"
:loading="searchLoading"
icon="i-heroicons-magnifying-glass-20-solid"
placeholder="搜索你的主题..."
size="md"
>
<template #trailing>
<UButton
v-show="searchQuery !== ''"
color="gray"
variant="link"
icon="i-heroicons-x-mark-20-solid"
:padded="false"
@click="handleClear"
/>
</template>
</UInput>
</div>
</div>
</div>
<div v-if="description" class="text-gray-500 ml-12 mt-2">{{ description }}</div>
</div>
<UDivider />
<div v-if="showTabs" class="w-full p-6 block lg:hidden">
<UTabs :model-value="tab" :items="tabs" @update:model-value="handleChangeTab" />
</div>
</div>
<div class="flex flex-col w-full items-center sticky top-0 bg-white dark:bg-black z-10">
<div class="container max-w-screen-lg 2xl:max-w-screen-xl flex flex-col p-6">
<div class="flex justify-between items-center gap-4">
<div class="flex gap-4">
<IMenuSider/>
<div v-if="!collect" class="flex flex-shrink-0 items-center text-xl gap-2">
<UIcon name="i-heroicons-rectangle-stack-20-solid"/>
<div>主题</div>
</div>
<template v-else>
<UButton
icon="i-heroicons-chevron-left"
color="gray"
variant="ghost"
to="/library"
/>
<div class="flex items-center text-xl gap-2">
<UIcon name="i-heroicons-squares-2x2"/>
<div>{{ collect }}</div>
<UBadge color="gray" variant="soft" :label="count"/>
</div>
</template>
</div>
<div class="flex flex-grow justify-end items-center gap-4">
<div class="flex">
<IActionCollect v-if="collect" :id="collectId"/>
</div>
<div v-if="!collect" class="flex">
<UInput
v-model="searchQuery"
name="queryInput"
:ui="{ icon: { trailing: { pointer: '' } } }"
:loading="searchLoading"
icon="i-heroicons-magnifying-glass-20-solid"
placeholder="搜索你的主题..."
size="md"
>
<template #trailing>
<UButton
v-show="searchQuery !== ''"
color="gray"
variant="link"
icon="i-heroicons-x-mark-20-solid"
:padded="false"
@click="handleClear"
/>
</template>
</UInput>
</div>
</div>
</div>
<div v-if="description" class="text-gray-500 ml-12 mt-2">{{ description }}</div>
</div>
<UDivider/>
<div v-if="showTabs" class="w-full p-6 block lg:hidden">
<UTabs :model-value="tab" :items="tabs" @update:model-value="handleChangeTab"/>
</div>
</div>
</template>
<script setup>
defineProps({
......
<template>
<ULink :to="`/search/${thread.c_id}`" class="flex flex-col group">
<div class="flex items-center gap-2 transition group-hover:text-primary">{{ thread.title }}</div>
<div v-if="false" class="break-word text-balance line-clamp-2 font-sans text-sm" :class="textColor">
{{ thread.description }}
</div>
</ULink>
<div class="flex justify-between items-center">
<div class="flex gap-4">
<UTooltip class="flex items-center text-sm gap-0.5" :class="textColor" :text="thread.is_public ? '公开主题,链接可被发现' : '私密主题,仅自己可见'">
<UIcon :name="thread.is_public ? 'i-heroicons-lock-open' : 'i-heroicons-lock-closed'" />
<span>{{ thread.is_public ? '公开' : '私有' }}</span>
</UTooltip>
<!-- <div class="flex items-center text-sm gap-0.5" :class="textColor">-->
<!-- <UIcon name="i-heroicons-eye" />-->
<!-- <span>1</span>-->
<!-- </div>-->
<div class="flex" :class="textColor">
<UTooltip class="flex items-center text-sm gap-0.5">
<UIcon name="i-heroicons-clock" />
<span>{{ useTime(thread.create_time) }}</span>
<template #text>
{{ toValue(useDateFormat(thread.create_time, 'YYYY年M月D日 HH:mm')) }}
</template>
</UTooltip>
</div>
</div>
<div class="flex gap-4">
<template v-for="collect in thread.collections" :key="collect.collection_id">
<UButton
:ui="{ rounded: 'rounded-full' }"
:to="`/library/${collect.collection_id}`"
color="white"
size="2xs"
:label="collect.collection_name"
/>
</template>
<UTooltip v-if="!thread.collections.length" text="添加到收藏">
<UButton
color="gray"
variant="ghost"
size="2xs"
square
icon="i-heroicons-plus"
@click="handleOpenSelect"
/>
</UTooltip>
<IActionThread
:collection_id="thread.collections.length ? thread.collections[0].collection_id : ''"
:c_id="item.c_id"
size="2xs"
@delete="handleDeletedThread"
/>
</div>
</div>
<UDivider />
<ULink :to="`/search/${thread.c_id}`" class="flex flex-col group">
<div class="flex items-center gap-2 transition group-hover:text-primary">{{ thread.title }}</div>
<div v-if="false" class="break-word text-balance line-clamp-2 font-sans text-sm" :class="textColor">
{{ thread.description }}
</div>
</ULink>
<div class="flex justify-between items-center">
<div class="flex gap-4">
<UTooltip class="flex items-center text-sm gap-0.5" :class="textColor"
:text="thread.is_public ? '公开主题,链接可被发现' : '私密主题,仅自己可见'">
<UIcon :name="thread.is_public ? 'i-heroicons-lock-open' : 'i-heroicons-lock-closed'"/>
<span>{{ thread.is_public ? '公开' : '私有' }}</span>
</UTooltip>
<!-- <div class="flex items-center text-sm gap-0.5" :class="textColor">-->
<!-- <UIcon name="i-heroicons-eye" />-->
<!-- <span>1</span>-->
<!-- </div>-->
<div class="flex" :class="textColor">
<UTooltip class="flex items-center text-sm gap-0.5">
<UIcon name="i-heroicons-clock"/>
<span>{{ useTime(thread.create_time) }}</span>
<template #text>
{{ toValue(useDateFormat(thread.create_time, 'YYYY年M月D日 HH:mm')) }}
</template>
</UTooltip>
</div>
</div>
<div class="flex gap-4">
<template v-for="collect in thread.collections" :key="collect.collection_id">
<UButton
:ui="{ rounded: 'rounded-full' }"
:to="`/library/${collect.collection_id}`"
color="white"
size="2xs"
:label="collect.collection_name"
/>
</template>
<UTooltip v-if="!thread.collections.length" text="添加到收藏">
<UButton
color="gray"
variant="ghost"
size="2xs"
square
icon="i-heroicons-plus"
@click="handleOpenSelect"
/>
</UTooltip>
<IActionThread
:collection_id="thread.collections.length ? thread.collections[0].collection_id : ''"
:c_id="item.c_id"
size="2xs"
@delete="handleDeletedThread"
/>
</div>
</div>
<UDivider/>
</template>
<script setup>
const Layout = inject('Layout')
......
<template>
<div class="grid grid-cols-1">
<MDC v-if="content" class="prose dark:prose-invert max-w-none" :class="'prose-' + size" :value="content" tag="article" />
</div>
<div class="grid grid-cols-1">
<MDC v-if="content" class="prose dark:prose-invert max-w-none" :class="'prose-' + size" :value="content"
tag="article"/>
</div>
</template>
<script setup>
defineProps({
......
<template>
<div class="flex w-full justify-center">
<UCard
class="hover:ring-2 has-[textarea:focus]:ring-2 has-[textarea:focus]:ring-primary-500 dark:has-[textarea:focus]:ring-primary-400"
:ui="cardUI"
>
<UTextarea
ref="queryInput"
v-model="continueQuestion"
class="flex-grow"
name="queryInput"
:rows="1"
:maxrows="10"
autoresize
:placeholder="placeholder"
size="xl"
:padded="false"
variant="none"
maxlength="2000"
@focus="handleInputFocus"
@blur="handleInputBlur"
/>
<div class="flex flex-shrink-0 gap-2">
<UButton
v-if="!asking"
:ui="{ rounded: 'rounded-full' }"
:disabled="!continueQuestion"
trailing-icon="i-heroicons-chevron-right-20-solid"
size="xl"
@click.stop="handleAsk"
/>
<UTooltip v-else text="停止生成">
<UButton
:ui="{ rounded: 'rounded-full' }"
color="red"
trailing-icon="i-heroicons-stop-20-solid"
size="xl"
variant="ghost"
@click.stop="handleStop"
/>
</UTooltip>
</div>
</UCard>
</div>
<div class="flex w-full justify-center">
<UCard
class="hover:ring-2 has-[textarea:focus]:ring-2 has-[textarea:focus]:ring-primary-500 dark:has-[textarea:focus]:ring-primary-400"
:ui="cardUI"
>
<UTextarea
ref="queryInput"
v-model="continueQuestion"
class="flex-grow"
name="queryInput"
:rows="1"
:maxrows="10"
autoresize
:placeholder="placeholder"
size="xl"
:padded="false"
variant="none"
maxlength="2000"
@focus="handleInputFocus"
@blur="handleInputBlur"
/>
<div class="flex flex-shrink-0 gap-2">
<UButton
v-if="!asking"
:ui="{ rounded: 'rounded-full' }"
:disabled="!continueQuestion"
trailing-icon="i-heroicons-chevron-right-20-solid"
size="xl"
@click.stop="handleAsk"
/>
<UTooltip v-else text="停止生成">
<UButton
:ui="{ rounded: 'rounded-full' }"
color="red"
trailing-icon="i-heroicons-stop-20-solid"
size="xl"
variant="ghost"
@click.stop="handleStop"
/>
</UTooltip>
</div>
</UCard>
</div>
</template>
<script setup>
const { metaSymbol } = useShortcuts()
......
<template>
<ISearchProcess :collapse="collapse" :actions="actions" :status="processStatus" />
<template v-if="item.source && item.source.length > 0">
<div class="text-xl flex items-center space-x-1">
<UIcon name="i-heroicons-link-20-solid" />
<span>来源</span>
</div>
<div class="grid grid-cols-1 lg:grid-cols-3 gap-4">
<ISearchSource :source="item.source" />
</div>
</template>
<div v-if="processStatus ==='finish'" class="text-xl flex items-center space-x-1">
<UIcon name="i-heroicons-chat-bubble-left-right-20-solid" />
<span>{{ item.ansLoading ? '回答中' : '回答' }}</span>
</div>
<IMdMdc :content="item.article" />
<div v-if="item.showActions" class="space-x-2">
<UButton size="xs" color="gray" leading-icon="i-heroicons-document-duplicate-20-solid" label="复制" @click="handleCopyMD" />
<UButton size="xs" color="gray" leading-icon="i-heroicons-share-20-solid" label="分享" @click="handleShare" />
<UButton v-if="isLastIndex" size="xs" color="gray" leading-icon="i-heroicons-arrow-path-rounded-square-20-solid" label="重写" @click="handleReGenerate" />
</div>
<ISearchProcess :collapse="collapse" :actions="actions" :status="processStatus"/>
<template v-if="item.source && item.source.length > 0">
<div class="text-xl flex items-center space-x-1">
<UIcon name="i-heroicons-link-20-solid"/>
<span>来源</span>
</div>
<div class="grid grid-cols-1 lg:grid-cols-3 gap-4">
<ISearchSource :source="item.source"/>
</div>
</template>
<div v-if="processStatus ==='finish'" class="text-xl flex items-center space-x-1">
<UIcon name="i-heroicons-chat-bubble-left-right-20-solid"/>
<span>{{ item.ansLoading ? '回答中' : '回答' }}</span>
</div>
<IMdMdc :content="item.article"/>
<div v-if="item.showActions" class="space-x-2">
<UButton size="xs" color="gray" leading-icon="i-heroicons-document-duplicate-20-solid" label="复制"
@click="handleCopyMD"/>
<UButton size="xs" color="gray" leading-icon="i-heroicons-share-20-solid" label="分享" @click="handleShare"/>
<UButton v-if="isLastIndex" size="xs" color="gray" leading-icon="i-heroicons-arrow-path-rounded-square-20-solid"
label="重写" @click="handleReGenerate"/>
</div>
</template>
<script setup>
const Search = inject('Search')
......
<template>
<header class="sticky top-0 z-10 bg-white dark:bg-black w-full flex flex-col">
<div class="w-full p-2 justify-between flex">
<IMenuSider />
<div class="hidden md:flex">
<div v-if="repo" class="flex items-center gap-2">
<UIcon name="i-simple-icons-github" />{{ repo }}
</div>
</div>
<div class="flex-grow justify-center items-center space-x-2 hidden sm:flex">
<UTooltip v-if="!isEditTitle" text="点击修改标题">
<div @click="handleFocusTitle">{{ editTitle }}</div>
</UTooltip>
<UInput
v-else
ref="titleRef"
autofocus
:model-value="editTitle"
@blur="handleBlurTitle"
/>
</div>
<div class="flex gap-2">
<IActionThread
:collection_id="$selectCollectionId.length ? $selectCollectionId[0] : ''"
:c_id="state.id"
@delete="handleDeletedThread"
/>
<UButton
color="gray"
variant="ghost"
leading-icon="i-heroicons-plus-small"
:label="$selectCollectionId.length ? '已收藏' : '收藏'"
@click="handleOpenSelect"
/>
<UPopover v-model:open="isShareOpen">
<UButton
:leading-icon="isOpen ? 'i-heroicons-share-16-solid' : 'i-heroicons-lock-closed-16-solid'"
label="分享"
@click="handleSetOpenState"
/>
<template #panel>
<div class="flex flex-col p-3 gap-2 min-w-72">
<div>访问权限</div>
<div class="flex flex-col border dark:border-gray-800 rounded">
<div
class="flex flex-grow justify-between m-1 p-1 cursor-pointer rounded hover:bg-gray-100 dark:hover:bg-gray-800"
@click="handleUpdateOpenState(false)"
>
<div class="flex-grow flex flex-col gap-1 text-sm">
<div class="flex items-center gap-1" :class="{ 'text-primary-500': !isOpen }">
<UIcon name="i-heroicons-lock-closed-16-solid" />
<span>私密</span>
</div>
<div class="text-xs text-gray-500">只有作者可以查看</div>
</div>
<div v-if="!isOpen">
<UIcon name="i-heroicons-check-circle-20-solid" class="text-primary-500 text-xl" />
</div>
</div>
<UDivider />
<div
class="flex flex-grow justify-between m-1 p-1 cursor-pointer rounded hover:bg-gray-100 dark:hover:bg-gray-800"
@click="handleUpdateOpenState(true)"
>
<div class="flex-grow flex flex-col gap-1 text-sm" :class="{ 'text-primary-500': isOpen }">
<div class="flex items-center gap-1">
<UIcon name="i-heroicons-share-20-solid" />
<span>可分享的</span>
</div>
<div class="text-xs text-gray-500">任何持有链接的人都可以查看</div>
</div>
<div v-if="isOpen">
<UIcon name="i-heroicons-check-circle-20-solid" class="text-primary-500 text-xl" />
</div>
</div>
</div>
<div v-if="isOpen" class="flex gap-1 items-center text-xs text-primary-500">
<UIcon name="i-heroicons-clipboard-document-check" />
<span>链接已复制</span>
</div>
</div>
</template>
</UPopover>
</div>
</div>
<UDivider />
</header>
<header class="sticky top-0 z-10 bg-white dark:bg-black w-full flex flex-col">
<div class="w-full p-2 justify-between flex">
<IMenuSider/>
<div class="hidden md:flex">
<div v-if="repo" class="flex items-center gap-2">
<UIcon name="i-simple-icons-github"/>
{{ repo }}
</div>
</div>
<div class="flex-grow justify-center items-center space-x-2 hidden sm:flex">
<UTooltip v-if="!isEditTitle" text="点击修改标题">
<div @click="handleFocusTitle">{{ editTitle }}</div>
</UTooltip>
<UInput
v-else
ref="titleRef"
autofocus
:model-value="editTitle"
@blur="handleBlurTitle"
/>
</div>
<div class="flex gap-2">
<IActionThread
:collection_id="$selectCollectionId.length ? $selectCollectionId[0] : ''"
:c_id="state.id"
@delete="handleDeletedThread"
/>
<UButton
color="gray"
variant="ghost"
leading-icon="i-heroicons-plus-small"
:label="$selectCollectionId.length ? '已收藏' : '收藏'"
@click="handleOpenSelect"
/>
<UPopover v-model:open="isShareOpen">
<UButton
:leading-icon="isOpen ? 'i-heroicons-share-16-solid' : 'i-heroicons-lock-closed-16-solid'"
label="分享"
@click="handleSetOpenState"
/>
<template #panel>
<div class="flex flex-col p-3 gap-2 min-w-72">
<div>访问权限</div>
<div class="flex flex-col border dark:border-gray-800 rounded">
<div
class="flex flex-grow justify-between m-1 p-1 cursor-pointer rounded hover:bg-gray-100 dark:hover:bg-gray-800"
@click="handleUpdateOpenState(false)"
>
<div class="flex-grow flex flex-col gap-1 text-sm">
<div class="flex items-center gap-1" :class="{ 'text-primary-500': !isOpen }">
<UIcon name="i-heroicons-lock-closed-16-solid"/>
<span>私密</span>
</div>
<div class="text-xs text-gray-500">只有作者可以查看</div>
</div>
<div v-if="!isOpen">
<UIcon name="i-heroicons-check-circle-20-solid" class="text-primary-500 text-xl"/>
</div>
</div>
<UDivider/>
<div
class="flex flex-grow justify-between m-1 p-1 cursor-pointer rounded hover:bg-gray-100 dark:hover:bg-gray-800"
@click="handleUpdateOpenState(true)"
>
<div class="flex-grow flex flex-col gap-1 text-sm" :class="{ 'text-primary-500': isOpen }">
<div class="flex items-center gap-1">
<UIcon name="i-heroicons-share-20-solid"/>
<span>可分享的</span>
</div>
<div class="text-xs text-gray-500">任何持有链接的人都可以查看</div>
</div>
<div v-if="isOpen">
<UIcon name="i-heroicons-check-circle-20-solid" class="text-primary-500 text-xl"/>
</div>
</div>
</div>
<div v-if="isOpen" class="flex gap-1 items-center text-xs text-primary-500">
<UIcon name="i-heroicons-clipboard-document-check"/>
<span>链接已复制</span>
</div>
</div>
</template>
</UPopover>
</div>
</div>
<UDivider/>
</header>
</template>
<script setup>
const toast = useToast()
......
<template>
<div class="text-xl flex items-center space-x-1">
<UIcon name="i-heroicons-rectangle-group-20-solid" />
<span>相关问题</span>
</div>
<div class="flex flex-col gap-2">
<UButton
<div class="text-xl flex items-center space-x-1">
<UIcon name="i-heroicons-rectangle-group-20-solid"/>
<span>相关问题</span>
</div>
<div class="flex flex-col gap-2">
<UButton
v-for="(item, index) in recommendQuestions"
:key="index"
color="gray"
......@@ -12,12 +12,12 @@
variant="soft"
@click="handleClick(item.title)"
>
<div class="justify-between w-full flex items-center">
<div class="truncate">{{ item.title }}</div>
<UIcon name="i-heroicons-plus-20-solid" class="text-base" />
</div>
</UButton>
</div>
<div class="justify-between w-full flex items-center">
<div class="truncate">{{ item.title }}</div>
<UIcon name="i-heroicons-plus-20-solid" class="text-base"/>
</div>
</UButton>
</div>
</template>
<script setup>
defineProps({
......
<template>
<ULink v-for="(item, index) in limitSource" :key="index" :to="item.url" :title="item.url" target="_blank">
<UCard :ui="cardUI">
<div class="flex flex-col h-full gap-1">
<template v-if="getIconPath(item.url) === 'github'">
<div class="items-center flex gap-1">
<UIcon name="i-simple-icons-github" class="flex-shrink-0" />
<div class="flex flex-grow overflow-hidden">
<div class="truncate">{{ item.title }}</div>
</div>
<div class="text-gray-200">{{ index + 1 }}</div>
</div>
<div class="text-blue-500 line-clamp-1">{{ item.label }}</div>
</template>
<template v-else>
<div class="flex gap-1 h-full">
<div class="line-clamp-2 text-sm">{{ item.title }}</div>
</div>
<div class="items-center flex gap-1">
<UAvatar :src="getIconPath(item.url)" size="2xs" class="flex-shrink-0" />
<div class="flex flex-grow overflow-hidden">
<div class="truncate text-xs text-gray-500">{{ getDomain(item.url) }}</div>
</div>
<div class="text-gray-200 text-sm">{{ index + 1 }}</div>
</div>
</template>
</div>
</UCard>
</ULink>
<UCard v-if="source.length > 6" class="cursor-pointer" :ui="cardUI" @click="handleToggleShowAll">
<div class="flex items-center justify-center h-full gap-1">
<UIcon v-if="!showAllSource" name="i-heroicons-chevron-down-20-solid" />
<UIcon v-else name="i-heroicons-chevron-up-20-solid" />
<div v-if="!showAllSource">查看全部{{ source.length }}个来源</div>
<div v-else>收起</div>
</div>
</UCard>
<ULink v-for="(item, index) in limitSource" :key="index" :to="item.url" :title="item.url" target="_blank">
<UCard :ui="cardUI">
<div class="flex flex-col h-full gap-1">
<template v-if="getIconPath(item.url) === 'github'">
<div class="items-center flex gap-1">
<UIcon name="i-simple-icons-github" class="flex-shrink-0"/>
<div class="flex flex-grow overflow-hidden">
<div class="truncate">{{ item.title }}</div>
</div>
<div class="text-gray-200">{{ index + 1 }}</div>
</div>
<div class="text-blue-500 line-clamp-1">{{ item.label }}</div>
</template>
<template v-else>
<div class="flex gap-1 h-full">
<div class="line-clamp-2 text-sm">{{ item.title }}</div>
</div>
<div class="items-center flex gap-1">
<UAvatar :src="getIconPath(item.url)" size="2xs" class="flex-shrink-0"/>
<div class="flex flex-grow overflow-hidden">
<div class="truncate text-xs text-gray-500">{{ getDomain(item.url) }}</div>
</div>
<div class="text-gray-200 text-sm">{{ index + 1 }}</div>
</div>
</template>
</div>
</UCard>
</ULink>
<UCard v-if="source.length > 6" class="cursor-pointer" :ui="cardUI" @click="handleToggleShowAll">
<div class="flex items-center justify-center h-full gap-1">
<UIcon v-if="!showAllSource" name="i-heroicons-chevron-down-20-solid"/>
<UIcon v-else name="i-heroicons-chevron-up-20-solid"/>
<div v-if="!showAllSource">查看全部{{ source.length }}个来源</div>
<div v-else>收起</div>
</div>
</UCard>
</template>
<script setup>
const props = defineProps({
......
<template>
<component :is="titleTag" :id="id" :class="{ 'text-3xl': titleTag !== 'div' }">{{ title }}</component>
<component :is="titleTag" :id="id" :class="{ 'text-3xl': titleTag !== 'div' }">{{ title }}</component>
</template>
<script setup>
const props = defineProps({
......
<template>
<UTable
:rows="data"
:columns="columns"
:ui="config"
:sort-button="sortButton"
>
<template #repo_name-data="{ row }">
<ULink :to="'https://github.com/' + row.repo_name" target="_blank">{{ row.repo_name }}</ULink>
</template>
<template #repo_url-data="{ row }">
<ULink :to="row.repo_url" target="_blank">{{ row.repo_url }}</ULink>
</template>
</UTable>
<UTable
:rows="data"
:columns="columns"
:ui="config"
:sort-button="sortButton"
>
<template #repo_name-data="{ row }">
<ULink :to="'https://github.com/' + row.repo_name" target="_blank">{{ row.repo_name }}</ULink>
</template>
<template #repo_url-data="{ row }">
<ULink :to="row.repo_url" target="_blank">{{ row.repo_url }}</ULink>
</template>
</UTable>
</template>
<script setup>
const props = defineProps({
......
<template>
<NuxtLink
:href="href"
:target="target"
>
<slot />
</NuxtLink>
<NuxtLink
:href="href"
:target="target"
>
<slot/>
</NuxtLink>
</template>
<script setup lang="ts">
......
<template>
<UCard :ui="cardUI">
<UCard :ui="cardUI">
<pre class="flex justify-between items-center m-0 p-1 pl-4 pr-1 rounded-none dark">
<div>{{ language }}</div>
<UButton
leading-icon="i-heroicons-document-duplicate-20-solid"
color="gray"
variant="link"
@click="handleCopy"
/>
</pre>
<UDivider :ui="{ border: { base: 'border-gray-700' } }" />
<pre :class="$props.class" class="m-0 rounded-none"><code v-html="codeBlock"/></pre>
</UCard>
<div>{{ language }}</div>
<UButton
leading-icon="i-heroicons-document-duplicate-20-solid"
color="gray"
variant="link"
@click="handleCopy"
/>
</pre>
<UDivider :ui="{ border: { base: 'border-gray-700' } }"/>
<pre :class="$props.class" class="m-0 rounded-none"><code v-html="codeBlock"/></pre>
</UCard>
</template>
<script setup>
......
......@@ -4,8 +4,8 @@ import withNuxt from './.nuxt/eslint.config.mjs'
export default withNuxt({
files: ['**/*.vue', '**/*.js'],
rules: {
'indent': [2, 2],
'vue/html-indent': ['off', 'tab', { }],
'vue/html-indent': ['off'],
'indent': ['error', 2],
'no-empty': ['error', { 'allowEmptyCatch': true }],
'vue/no-v-html': 'off',
'no-useless-escape': 'error',
......
<template>
<slot />
<slot/>
</template>
<template>
<div class="w-full items-center flex flex-col">
<ILibraryHeader
v-if="currentCollect"
:collect="currentCollect.name"
:description="currentCollect.description"
:count="currentCollect.record_count"
:collect-id="currentCollect.id"
/>
<div class="container max-w-screen-lg 2xl:max-w-screen-xl flex flex-col p-6">
<div class="flex gap-10">
<div class="flex flex-col flex-grow">
<div v-auto-animate class="flex flex-col gap-4">
<ILibraryThread
v-for="item in themesTagList"
:key="item.id"
:item="item"
is-item
@delete="handleDeletedThread"
/>
</div>
</div>
</div>
</div>
</div>
<div class="w-full items-center flex flex-col">
<ILibraryHeader
v-if="currentCollect"
:collect="currentCollect.name"
:description="currentCollect.description"
:count="currentCollect.record_count"
:collect-id="currentCollect.id"
/>
<div class="container max-w-screen-lg 2xl:max-w-screen-xl flex flex-col p-6">
<div class="flex gap-10">
<div class="flex flex-col flex-grow">
<div v-auto-animate class="flex flex-col gap-4">
<ILibraryThread
v-for="item in themesTagList"
:key="item.id"
:item="item"
is-item
@delete="handleDeletedThread"
/>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
const route = useRoute()
......
<template>
<div class="w-full items-center flex flex-col">
<ILibraryHeader show-tabs :tab="tab" @change-tab="handleChangeTab" @search="handleSearch" @clear="getThreadData" />
<div class="container max-w-screen-lg 2xl:max-w-screen-xl flex flex-col p-6 pt-0 lg:pt-6">
<div v-show="ready" class="flex gap-10">
<div v-show="tab === 0 || tab === -1" class="flex flex-col flex-grow">
<div v-auto-animate class="flex flex-col gap-4">
<ILibraryThread
v-for="item in threads"
:key="item.c_id"
:item="item"
@delete="handleDeletedThread"
/>
<IEmpty v-if="!threads.length" />
</div>
</div>
<div v-show="tab === 1 || tab === -1" class="flex flex-col flex-shrink-0 w-full lg:w-56">
<div class="flex justify-between items-center">
<div class="flex items-center text-lg gap-2">
<UIcon name="i-heroicons-squares-2x2" />
<div>合集</div>
</div>
<UButton
icon="i-heroicons-plus-20-solid"
variant="soft"
@click="handleOpenCreateLibrary"
/>
</div>
<div v-auto-animate class="flex flex-col gap-4 mt-4">
<ILibraryCollect
v-for="item in $collection"
:key="item.id"
:item="item"
/>
</div>
</div>
</div>
</div>
</div>
<div class="w-full items-center flex flex-col">
<ILibraryHeader show-tabs :tab="tab" @change-tab="handleChangeTab" @search="handleSearch" @clear="getThreadData"/>
<div class="container max-w-screen-lg 2xl:max-w-screen-xl flex flex-col p-6 pt-0 lg:pt-6">
<div v-show="ready" class="flex gap-10">
<div v-show="tab === 0 || tab === -1" class="flex flex-col flex-grow">
<div v-auto-animate class="flex flex-col gap-4">
<ILibraryThread
v-for="item in threads"
:key="item.c_id"
:item="item"
@delete="handleDeletedThread"
/>
<IEmpty v-if="!threads.length"/>
</div>
</div>
<div v-show="tab === 1 || tab === -1" class="flex flex-col flex-shrink-0 w-full lg:w-56">
<div class="flex justify-between items-center">
<div class="flex items-center text-lg gap-2">
<UIcon name="i-heroicons-squares-2x2"/>
<div>合集</div>
</div>
<UButton
icon="i-heroicons-plus-20-solid"
variant="soft"
@click="handleOpenCreateLibrary"
/>
</div>
<div v-auto-animate class="flex flex-col gap-4 mt-4">
<ILibraryCollect
v-for="item in $collection"
:key="item.id"
:item="item"
/>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import {LG} from '~/composables/useMQ.js';
......
<template>
<div class="w-full items-center flex flex-col">
<IException v-if="historyStatus !== 200" :code="historyStatus" />
<template v-else>
<iSearchHeader
ref="refHeader"
:query="state.title"
:is-public="state.isPublic"
:repo="state.repo"
@update-query="handleUpdateQuery"
/>
<div ref="scrollElement" class="container min-h-svh max-w-screen-lg 2xl:max-w-screen-xl flex flex-col space-y-6 p-6 mb-6 pb-0">
<template v-for="(item, index) in data" :key="index">
<ISearchArticle>
<template #title>
<ISearchTitle :id="index + 1" as="h2" :title="item.question" />
</template>
<ISearchContent
:item="item"
:asking="false"
:is-last-index="false"
:index="index"
:actions="item.actions"
:collapse="false"
process-status="finish"
/>
<template v-if="item.extra && item.extra.length > 0" #extra>
<ISearchExtraInfo :data="item.extra" />
</template>
</ISearchArticle>
<UDivider v-if="data.length !== index + 1 || askingData.question" class="pt-3 pb-2" />
</template>
<template v-if="askingData.question">
<ISearchArticle>
<template #title>
<ISearchTitle :id="data.length + 1" as="h2" :title="askingData.question" />
</template>
<ISearchContent
:item="askingData"
:asking="asking"
:collapse="askingData.collapse"
:is-last-index="true"
:actions="askingData.actions"
:process-status="askingData.processStatus"
@regenerate="handleReGenerate"
/>
<template v-if="askingSidebarCards.length > 0" #extra>
<ISearchExtraInfo :data="askingSidebarCards" />
</template>
</ISearchArticle>
</template>
<ISearchRecommendQuestion
v-if="recommendQuestions.length > 0 && !asking"
:recommend-questions="recommendQuestions"
@click="handleContinueAsk"
/>
</div>
<div class="container max-w-screen-lg 2xl:max-w-screen-xl sticky bottom-4 flex pl-6 pr-6">
<ISearchAsk :asking="asking" @stop="handleStopGenerate" @ask="handleContinueAsk" />
</div>
</template>
</div>
<div class="w-full items-center flex flex-col">
<IException v-if="historyStatus !== 200" :code="historyStatus"/>
<template v-else>
<iSearchHeader
ref="refHeader"
:query="state.title"
:is-public="state.isPublic"
:repo="state.repo"
@update-query="handleUpdateQuery"
/>
<div ref="scrollElement"
class="container min-h-svh max-w-screen-lg 2xl:max-w-screen-xl flex flex-col space-y-6 p-6 mb-6 pb-0">
<template v-for="(item, index) in data" :key="index">
<ISearchArticle>
<template #title>
<ISearchTitle :id="index + 1" as="h2" :title="item.question"/>
</template>
<ISearchContent
:item="item"
:asking="false"
:is-last-index="false"
:index="index"
:actions="item.actions"
:collapse="false"
process-status="finish"
/>
<template v-if="item.extra && item.extra.length > 0" #extra>
<ISearchExtraInfo :data="item.extra"/>
</template>
</ISearchArticle>
<UDivider v-if="data.length !== index + 1 || askingData.question" class="pt-3 pb-2"/>
</template>
<template v-if="askingData.question">
<ISearchArticle>
<template #title>
<ISearchTitle :id="data.length + 1" as="h2" :title="askingData.question"/>
</template>
<ISearchContent
:item="askingData"
:asking="asking"
:collapse="askingData.collapse"
:is-last-index="true"
:actions="askingData.actions"
:process-status="askingData.processStatus"
@regenerate="handleReGenerate"
/>
<template v-if="askingSidebarCards.length > 0" #extra>
<ISearchExtraInfo :data="askingSidebarCards"/>
</template>
</ISearchArticle>
</template>
<ISearchRecommendQuestion
v-if="recommendQuestions.length > 0 && !asking"
:recommend-questions="recommendQuestions"
@click="handleContinueAsk"
/>
</div>
<div class="container max-w-screen-lg 2xl:max-w-screen-xl sticky bottom-4 flex pl-6 pr-6">
<ISearchAsk :asking="asking" @stop="handleStopGenerate" @ask="handleContinueAsk"/>
</div>
</template>
</div>
</template>
<script setup>
const route = useRoute()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册