63 lines
1.8 KiB
Markdown
63 lines
1.8 KiB
Markdown
<cn>
|
|
#### ้
ๅ List ็ปไปถ
|
|
้
ๅ List ็ปไปถๅฑ็ฐ่ฏ่ฎบๅ่กจใ
|
|
</cn>
|
|
|
|
<us>
|
|
#### Usage with list
|
|
Displaying a series of comments using the `antd` List Component.
|
|
</us>
|
|
|
|
```vue
|
|
<template>
|
|
<a-list
|
|
class="comment-list"
|
|
:header="`${data.length} replies`"
|
|
item-layout="horizontal"
|
|
:data-source="data"
|
|
>
|
|
<a-list-item slot="renderItem" slot-scope="item, index">
|
|
<a-comment :author="item.author" :avatar="item.avatar">
|
|
<template slot="actions">
|
|
<span v-for="action in item.actions">{{ action }}</span>
|
|
</template>
|
|
<p slot="content">
|
|
{{ item.content }}
|
|
</p>
|
|
<a-tooltip slot="datetime" :title="item.datetime.format('YYYY-MM-DD HH:mm:ss')">
|
|
<span>{{ item.datetime.fromNow() }}</span>
|
|
</a-tooltip>
|
|
</a-comment>
|
|
</a-list-item>
|
|
</a-list>
|
|
</template>
|
|
<script>
|
|
import moment from 'moment';
|
|
export default {
|
|
data() {
|
|
return {
|
|
data: [
|
|
{
|
|
actions: ['Reply to'],
|
|
author: 'Han Solo',
|
|
avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
|
|
content:
|
|
'We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.',
|
|
datetime: moment().subtract(1, 'days'),
|
|
},
|
|
{
|
|
actions: ['Reply to'],
|
|
author: 'Han Solo',
|
|
avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
|
|
content:
|
|
'We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.',
|
|
datetime: moment().subtract(2, 'days'),
|
|
},
|
|
],
|
|
moment,
|
|
};
|
|
},
|
|
};
|
|
</script>
|
|
```
|