Commit 3a132f3f4f4e08b4675c157548aa093b3a1c3c94
1 parent
737b1b19
feat: add card-list page
Showing
5 changed files
with
148 additions
and
0 deletions
src/router/menus/modules/demo/page.ts
@@ -106,6 +106,19 @@ const menu: MenuModule = { | @@ -106,6 +106,19 @@ const menu: MenuModule = { | ||
106 | }, | 106 | }, |
107 | ], | 107 | ], |
108 | }, | 108 | }, |
109 | + { | ||
110 | + path: 'list', | ||
111 | + name: '列表页', | ||
112 | + tag: { | ||
113 | + content: 'new', | ||
114 | + }, | ||
115 | + children: [ | ||
116 | + { | ||
117 | + path: 'card', | ||
118 | + name: '卡片列表', | ||
119 | + }, | ||
120 | + ], | ||
121 | + }, | ||
109 | ], | 122 | ], |
110 | }, | 123 | }, |
111 | }; | 124 | }; |
src/router/routes/modules/demo/page.ts
@@ -209,6 +209,26 @@ const page: AppRouteModule = { | @@ -209,6 +209,26 @@ const page: AppRouteModule = { | ||
209 | ], | 209 | ], |
210 | }, | 210 | }, |
211 | // =============================exception end============================= | 211 | // =============================exception end============================= |
212 | + // =============================list start============================= | ||
213 | + { | ||
214 | + path: '/list', | ||
215 | + name: 'ListPage', | ||
216 | + redirect: '/page-demo/list/card', | ||
217 | + meta: { | ||
218 | + title: '列表页', | ||
219 | + }, | ||
220 | + children: [ | ||
221 | + { | ||
222 | + path: 'card', | ||
223 | + name: 'ListCardPage', | ||
224 | + component: () => import('/@/views/demo/page/list/card/index.vue'), | ||
225 | + meta: { | ||
226 | + title: '卡片列表', | ||
227 | + }, | ||
228 | + }, | ||
229 | + ], | ||
230 | + }, | ||
231 | + // =============================list end============================= | ||
212 | ], | 232 | ], |
213 | }; | 233 | }; |
214 | 234 |
src/views/demo/page/account/center/Application.vue
src/views/demo/page/list/card/data.tsx
0 → 100644
1 | +export const cardList = (() => { | ||
2 | + const result: any[] = []; | ||
3 | + for (let i = 0; i < 12; i++) { | ||
4 | + result.push({ | ||
5 | + title: 'Vben Admin', | ||
6 | + icon: 'logos:ant-design', | ||
7 | + color: '#1890ff', | ||
8 | + active: '100', | ||
9 | + new: '1,799', | ||
10 | + download: 'bx:bx-download', | ||
11 | + }); | ||
12 | + } | ||
13 | + return result; | ||
14 | +})(); |
src/views/demo/page/list/card/index.vue
0 → 100644
1 | +<template> | ||
2 | + <div :class="prefixCls"> | ||
3 | + <a-page-header title="卡片列表" :ghost="false"> | ||
4 | + 基于Vue Next, TypeScript, Ant Design实现的一套完整的企业级后台管理系统。 | ||
5 | + <div :class="`${prefixCls}__link`"> | ||
6 | + <a><Icon icon="bx:bx-paper-plane" color="#1890ff" /><span>开始</span></a> | ||
7 | + <a><Icon icon="carbon:warning" color="#1890ff" /><span>简介</span></a> | ||
8 | + <a><Icon icon="gg:loadbar-doc" color="#1890ff" /><span>文档</span></a> | ||
9 | + </div> | ||
10 | + </a-page-header> | ||
11 | + | ||
12 | + <div :class="`${prefixCls}__content`"> | ||
13 | + <List> | ||
14 | + <a-row :gutter="16"> | ||
15 | + <template v-for="(item, index) in list" :key="index"> | ||
16 | + <a-col :span="6"> | ||
17 | + <ListItem> | ||
18 | + <Card :hoverable="true" :class="`${prefixCls}__card`"> | ||
19 | + <div :class="`${prefixCls}__card-title`"> | ||
20 | + <Icon class="icon" v-if="item.icon" :icon="item.icon" :color="item.color" /> | ||
21 | + {{ item.title }} | ||
22 | + </div> | ||
23 | + <div :class="`${prefixCls}__card-detail`"> | ||
24 | + 基于Vue Next, TypeScript, Ant Design实现的一套完整的企业级后台管理系统 | ||
25 | + </div> | ||
26 | + </Card> | ||
27 | + </ListItem> | ||
28 | + </a-col> | ||
29 | + </template> | ||
30 | + </a-row> | ||
31 | + </List> | ||
32 | + </div> | ||
33 | + </div> | ||
34 | +</template> | ||
35 | +<script lang="ts"> | ||
36 | + import { defineComponent } from 'vue'; | ||
37 | + import { List, Card } from 'ant-design-vue'; | ||
38 | + import Icon from '/@/components/Icon/index'; | ||
39 | + import { cardList } from './data'; | ||
40 | + | ||
41 | + export default defineComponent({ | ||
42 | + components: { Icon, List, ListItem: List.Item, Card }, | ||
43 | + setup() { | ||
44 | + return { | ||
45 | + prefixCls: 'list-card', | ||
46 | + list: cardList, | ||
47 | + }; | ||
48 | + }, | ||
49 | + }); | ||
50 | +</script> | ||
51 | +<style lang="less" scoped> | ||
52 | + .list-card { | ||
53 | + &__link { | ||
54 | + margin-top: 10px; | ||
55 | + font-size: 14px; | ||
56 | + | ||
57 | + a { | ||
58 | + margin-right: 30px; | ||
59 | + } | ||
60 | + | ||
61 | + span { | ||
62 | + margin-left: 5px; | ||
63 | + } | ||
64 | + } | ||
65 | + | ||
66 | + &__content { | ||
67 | + padding: 12px 24px; | ||
68 | + // background: #fff; | ||
69 | + } | ||
70 | + | ||
71 | + &__card { | ||
72 | + width: 100%; | ||
73 | + margin-bottom: -8px; | ||
74 | + | ||
75 | + .ant-card-body { | ||
76 | + padding: 16px; | ||
77 | + } | ||
78 | + | ||
79 | + &-title { | ||
80 | + margin-bottom: 5px; | ||
81 | + font-size: 16px; | ||
82 | + font-weight: 500; | ||
83 | + color: rgba(0, 0, 0, 0.85); | ||
84 | + | ||
85 | + .icon { | ||
86 | + margin-top: -5px; | ||
87 | + margin-right: 10px; | ||
88 | + font-size: 38px !important; | ||
89 | + } | ||
90 | + } | ||
91 | + | ||
92 | + &-detail { | ||
93 | + padding-top: 10px; | ||
94 | + padding-left: 30px; | ||
95 | + font-size: 14px; | ||
96 | + color: rgba(0, 0, 0, 0.5); | ||
97 | + } | ||
98 | + } | ||
99 | + } | ||
100 | +</style> |