Skip to content

Commit

Permalink
feat(project): 丰富卡片列表内容
Browse files Browse the repository at this point in the history
  • Loading branch information
chansee97 committed Sep 30, 2022
1 parent debedb6 commit 58205fb
Showing 1 changed file with 100 additions and 2 deletions.
102 changes: 100 additions & 2 deletions src/views/list/cardList/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,105 @@
<template>
<div>卡片列表页</div>
<n-card>
<n-radio-group v-model:value="currentRadio" name="radiobuttongroup1">
<n-radio-button v-for="item in radioDate" :key="item.value" :value="item.value" :label="item.label" />
</n-radio-group>
<n-card
v-for="item in cardData"
v-show="currentRadio === 0 || item.id === currentRadio"
:key="item.id"
:bordered="false"
:title="item.title"
content-style="padding: 0;"
>
<n-grid :x-gap="8" :y-gap="8">
<n-gi v-for="card in item.children" :key="card.id" :span="6">
<n-card hoverable>
<n-thing content-indented :title="card.title" description="09/30/2022" :content="card.content">
<template #avatar>
<n-icon color="#de4307" size="24">
<i-icon-park-outline-chart-histogram />
</n-icon>
</template>
<template #action>
<n-space justify="space-between">
<span></span>
<n-button>开通</n-button>
</n-space>
</template>
<template #header-extra>
<n-tag type="info">生效中</n-tag>
</template>
</n-thing>
</n-card>
</n-gi>
</n-grid>
</n-card>
</n-card>
</template>

<script setup lang="ts"></script>
<script setup lang="ts">
import { ref } from 'vue';
const currentRadio = ref(0);
const cardData = [
{
title: '一类',
id: 1,
children: [
{
id: 0,
title: '卡片',
content: '卡片内容',
},
{
id: 1,
title: '卡片2',
content: '卡片2内容',
},
],
},
{
title: '二类',
id: 2,
children: [
{
id: 0,
title: '卡片',
content: '卡片内容',
},
{
id: 1,
title: '卡片2',
content: '卡片2内容',
},
],
},
{
title: '三类',
id: 3,
children: [
{
id: 0,
title: '卡片',
content: '卡片内容',
},
{
id: 1,
title: '卡片2',
content: '卡片2内容',
},
],
},
];
const radioDate = [
{
value: 0,
label: '全部',
},
...cardData.map((item) => {
return { value: item.id, label: item.title };
}),
];
</script>

<style scoped></style>

1 comment on commit 58205fb

@vercel
Copy link

@vercel vercel bot commented on 58205fb Sep 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ench-admin – ./

ench-admin.vercel.app
ench-admin-git-main-whyhenin.vercel.app
ench-admin-whyhenin.vercel.app

Please sign in to comment.