Skip to content

Commit e80fe58

Browse files
authored
Merge pull request #120 from glsnb/master
Add List + Page template
2 parents 4385f45 + 3c76d00 commit e80fe58

File tree

4 files changed

+86
-0
lines changed

4 files changed

+86
-0
lines changed

website/config/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@ export default {
290290
label: 'Combined-Forms',
291291
name: '/examples/combined-forms'
292292
},
293+
{
294+
label: 'Message-List',
295+
name: '/examples/message-list'
296+
}
293297

294298
]
295299
},
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import index from './index.vue';
2+
3+
export default index;
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<template>
2+
<div class="fg-message-list-demo">
3+
<List
4+
item-layout="vertical"
5+
>
6+
<ListItem v-for="item in data.list" :key="item.title">
7+
<ListItemMeta :avatar="item.avatar" :title="item.title" :description="item.description" />
8+
{{ item.content }}
9+
</ListItem>
10+
</List>
11+
<Page
12+
class="fg-message-list-demo-page"
13+
v-if="showPage"
14+
:show-total="showPageTotal"
15+
:current="data.page"
16+
:total="data.total"
17+
:page-size="data.pageSize"
18+
/>
19+
</div>
20+
</template>
21+
22+
<script>
23+
24+
export default {
25+
data() {
26+
return {
27+
showPage: true,
28+
showPageTotal: true,
29+
data: {
30+
total: 5,
31+
page: 1,
32+
pageSize: 5,
33+
list: [
34+
{
35+
title: 'This is title 1',
36+
description: 'This is description, this is description, this is description.',
37+
avatar: 'https://dev-file.iviewui.com/userinfoPDvn9gKWYihR24SpgC319vXY8qniCqj4/avatar'
38+
},
39+
{
40+
title: 'This is title 2',
41+
description: 'This is description, this is description, this is description.',
42+
avatar: 'https://dev-file.iviewui.com/userinfoPDvn9gKWYihR24SpgC319vXY8qniCqj4/avatar'
43+
},
44+
{
45+
title: 'This is title 3',
46+
description: 'This is description, this is description, this is description.',
47+
avatar: 'https://dev-file.iviewui.com/userinfoPDvn9gKWYihR24SpgC319vXY8qniCqj4/avatar'
48+
},
49+
{
50+
title: 'This is title 4',
51+
description: 'This is description, this is description, this is description.',
52+
avatar: 'https://dev-file.iviewui.com/userinfoPDvn9gKWYihR24SpgC319vXY8qniCqj4/avatar'
53+
},
54+
{
55+
title: 'This is title 5',
56+
description: 'This is description, this is description, this is description.',
57+
avatar: 'https://dev-file.iviewui.com/userinfoPDvn9gKWYihR24SpgC319vXY8qniCqj4/avatar'
58+
}
59+
]
60+
}
61+
};
62+
}
63+
};
64+
</script>
65+
66+
<style lang="less">
67+
.fg-message-list-demo {
68+
padding: 20px;
69+
&-page {
70+
float: right;
71+
}
72+
}
73+
</style>

website/router/routers.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ const twoRelatedForm = () => import(/* webpackChunkName: "twoRelatedForm" */ '..
7373
const auditExample = () => import(/* webpackChunkName: "auditExample" */ '../page/examples/audit/detail');
7474
const dynamicForm = () => import(/* webpackChunkName: "dynamicForm" */ '../page/examples/dynamic-form');
7575
const combinedForms = () => import(/* webpackChunkName: "combinedForms" */ '../page/examples/combined-forms');
76+
const messageList = () => import(/* webpackChunkName: "messageList" */ '../page/examples/message-list');
7677

7778
export default [
7879
{
@@ -420,6 +421,11 @@ export default [
420421
path: '/examples/combined-forms',
421422
name: 'combined-forms',
422423
component: combinedForms
424+
},
425+
{
426+
path: '/examples/message-list',
427+
name: 'message-list',
428+
component: messageList
423429
}
424430
]
425431
}

0 commit comments

Comments
 (0)