|
| 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> |
0 commit comments