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

thread

上级 538bb4b2
......@@ -6,7 +6,7 @@
<div class="flex">
<div class="flex items-center text-gray-500 text-sm gap-0.5">
<UIcon name="i-heroicons-square-3-stack-3d" />
<span>1</span>
<span>{{ item.record_count }}</span>
</div>
</div>
</div>
......
......@@ -29,7 +29,7 @@
@click="handleSelected(item.id)"
>
<div class="flex flex-grow justify-between items-center">
<div>{{item.name}}</div>
<div>{{ item.name }}</div>
<UIcon v-if="selected.includes(item.id)" name="i-heroicons-check-circle-20-solid" class="text-primary text-lg" />
</div>
</UButton>
......@@ -73,6 +73,8 @@ async function handleSelected(id) {
selected.value = [id]
}
async function handleSave() {
console.log(788)
return
if (loading.value) return
loading.value = true
// 取消合集
......
<template>
<ULink :to="`/search/${item.c_id}`" class="flex flex-col group">
<div class="transition truncate group-hover:text-primary">{{ item.title }}</div>
<ULink :to="`/search/${thread.c_id}`" class="flex flex-col group">
<div class="transition truncate group-hover:text-primary">{{ thread.title }}</div>
<div class="break-word text-balance line-clamp-2 font-sans text-base" :class="textColor">
{{ item.description || ' 待补充' }}
{{ thread.description || ' 待补充' }}
</div>
</ULink>
<div class="flex justify-between items-center">
......@@ -13,18 +13,20 @@
</div>
<div class="flex items-center text-sm gap-0.5" :class="textColor">
<UIcon name="i-heroicons-clock" />
<span>{{ useTime(item.create_time) }}</span>
<span>{{ useTime(thread.create_time) }}</span>
</div>
</div>
<div class="flex gap-4">
<UButton
:ui="{ rounded: 'rounded-full' }"
to="/library/123"
color="white"
size="2xs"
label="前端开发"
/>
<UTooltip text="添加到收藏">
<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 text="添加到收藏" v-if="!thread.collections.length">
<UButton
color="gray"
variant="ghost"
......@@ -45,9 +47,30 @@ const props = defineProps({
item: {
type: Object,
default: (() => {})()
},
isItem: {
type: Boolean,
default: false
}
})
const thread = computed(() => {
if (!props.isItem) return props.item
else {
const item = props.item
item.title = props.item.c_title
item.collections = []
if (props.item.collection_id && props.item.collection_name) {
item.collections = [
{
collection_id: props.item.collection_id,
collection_name: props.item.collection_name
}
]
}
return item
}
})
function handleOpenSelect (id) {
$openLibrarySelect(id)
function handleOpenSelect () {
$openLibrarySelect(props.item.c_id)
}
</script>
\ No newline at end of file
......@@ -9,6 +9,7 @@
v-for="item in themesTagList"
:item="item"
:key="item.id"
is-item
/>
</div>
</div>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册