comment.vue
1.6 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<template>
<!-- 评论 -->
<view class="commentBox" v-for="item in commentList" :key="item.id">
<view class="info flexA">
<image :src="item.avatar" mode=""></image>
<view class="name">
<view>{{ item.nickname }}</view>
<text>{{ item.createtime }}</text>
</view>
</view>
<view class="openM">
<open :text="item.content"></open>
</view>
<view class="imageBox">
<image v-for="it in item.image" :src="it" mode=""></image>
</view>
</view>
</template>
<script setup>
import { ref, reactive, onMounted } from 'vue'
import open from './openComment.vue'
let props = defineProps({
commentList: {
type: Array,
default: []
}
})
onMounted(() => {
props.commentList.forEach(item => {
item.image = item.image.split(',')
})
// console.log('评论',props.commentList)
})
const shadowStyle = reactive({
backgroundImage: 'none',
paddingTop: '0',
marginTop: '0'
})
</script>
<style lang="scss">
.commentBox {
.info {
margin-bottom: 24rpx;
image {
width: 88rpx;
height: 88rpx;
border-radius: 50%;
margin-right: 24rpx;
}
.name {
:nth-child(1) {
color: #131a14d9;
font-size: 28rpx;
font-weight: 700;
line-height: 40rpx;
}
text {
color: #131a1466;
font-size: 24rpx;
margin-top: 4rpx;
}
}
}
.imageBox {
margin-top: 10rpx;
display: flex;
flex-wrap: wrap;
image {
width: 226rpx;
height: 226rpx;
border-radius: 32rpx;
margin: 0 12rpx 12rpx 0;
}
:nth-child(3n) {
margin-right: 0 !important;
}
}
}
</style>