TOPVERSE_Official/pages/community/vamx.vue

91 lines
2.3 KiB
Vue
Raw Normal View History

2023-06-06 14:51:43 +08:00
<script setup>
2023-06-06 15:35:42 +08:00
import { useCommunityArticle } from '~/config/pages/community/use-community-article'
import { useCommunityTag } from '~/config/pages/community/use-community-tag'
2023-06-06 14:51:43 +08:00
2023-06-06 15:35:42 +08:00
const items = useCommunityArticle()
const tags = useCommunityTag()
2023-06-06 14:51:43 +08:00
const data = ref([])
const list = computed(() => {
if (!data.value.length)
return items
return items.filter((i) => {
return i.tags.some(j => data.value.includes(j))
})
})
2023-06-06 15:35:42 +08:00
const status = [
{
color: 'bg-green',
text: 'level[0]',
2023-06-06 15:35:42 +08:00
},
{
color: 'bg-amber',
text: 'level[1]',
2023-06-06 15:35:42 +08:00
},
{
color: 'bg-rose',
text: 'level[2]',
2023-06-06 15:35:42 +08:00
},
]
2023-06-01 18:10:04 +08:00
</script>
<template>
2023-06-06 14:51:43 +08:00
<div class="mt-10 md:mt-20">
<Section class="flex flex-col gap-4 md:flex-row">
<div>
<ACard
shadow="none"
2023-06-08 10:42:29 +08:00
:title="$t('community.vamx.sider.title')"
:subtitle="$t('filtrate.discription')"
2023-06-06 14:51:43 +08:00
class="w-full md:w-300px"
>
<!-- <img
src="/images/demo/minimal-1.jpg"
alt="girl"
> -->
<div class="a-card-body a-card-spacer">
<div class="grid grid-rows-2 gap-y-3">
<ACheckbox
v-for="tag in tags"
:key="tag.value"
v-model="data"
:value="tag.value"
:label="$t(tag.label)"
/>
</div>
<!-- <ABtn>Read more</ABtn> -->
</div>
</ACard>
</div>
<div class="3xl:grid-cols-4 grid-row w-full pb-10 2xl:grid-cols-3 lg:grid-cols-2">
<!-- 👉 2nd card -->
2023-06-12 16:49:37 +08:00
<Card
2023-06-06 15:35:42 +08:00
v-for="(item, i) in list"
2023-06-06 14:51:43 +08:00
:key="i"
2023-06-12 16:49:37 +08:00
:class="[`animated-delay-${i * 100}ms`]"
:title="item.title"
2023-06-06 15:35:42 +08:00
:href="item.href"
2023-06-12 16:49:37 +08:00
:description="item.subtitle"
:img="item.img"
:avatar="item.avatar"
:author="item.author"
:profession="item.profession"
:create-time="item.createTime"
2023-06-06 14:51:43 +08:00
>
2023-06-12 16:49:37 +08:00
<template #footer>
<div class="flex flex-shrink-0 items-center gap-2">
2023-06-06 15:35:42 +08:00
<div class="h-10px w-10px rounded-full" :class="status[item.level].color" />
{{ $t(status[item.level].text) }}
2023-06-06 15:35:42 +08:00
</div>
2023-06-12 16:49:37 +08:00
</template>
</Card>
2023-06-06 14:51:43 +08:00
</div>
</Section>
</div>
2023-06-01 18:10:04 +08:00
</template>