# 评论列表组件开发
<template>
<view class="uni-comment-list" :class="{'u-comment-list-child': (item.fid>0)}">
<view class="uni-comment-face">
<image :src="item.userpic" mode="widthFix"></image>
</view>
<view class="uni-comment-body" >
<view class="uni-comment-top"><text>{{item.username}}</text>
</view>
<view class="uni-comment-content">{{item.data}}</view>
<view class="uni-comment-date">
<view>{{item.time}}</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
item: Object,
index: Number
}
}
</script>
<style lang="less" scoped>
.u-comment-list-child {
padding: 20rpx;
background-color: #f4f4f4;
border-bottom: 1rpx solid #eee;
box-sizing: border-box;
margin: 0;
margin-left: 70rpx;
width: auto;
}
</style>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36