openComment.vue
1.7 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
88
89
90
91
92
93
94
95
96
97
98
99
100
<template>
<view>
<view class="Express">
<view class="info">
<view :class="{hide:!iSinfo}" class="flexA">
{{text}}
</view>
<view class="open" @tap="showinfo" v-if="!iSinfo & text.length>100">
<view class="dot">...</view>
全文
</view>
</view>
<text @tap="showinfo" v-if="iSinfo" class="hidebtn">收起</text>
</view>
</view>
</template>
<script>
export default {
props:{
text:{
type:String,
default:''
}
},
data() {
return {
iSinfo: false
}
},
methods: {
showinfo() {
this.iSinfo = !this.iSinfo
}
}
}
</script>
<style lang="scss">
page {
background-color: #fff;
}
.Express {
display: flex;
flex-direction: column;
background-color: #fff;
position: relative;
.info {
display: flex;
flex-direction: column;
view {
text-align: justify;
font-size: 14px;
font-weight: 400;
color: rgba(102, 102, 102, 1);
word-break: break-word; //换行模式
background-color: #fff;
}
.open {
width: 112rpx;
font-size: 14px;
display: flex;
justify-content: flex-end;
align-items: center;
// background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 50%);
color: #75CA42;
position: absolute;
bottom: 0upx;
right: 0upx;
.dot {
margin-right: 30rpx;
}
}
}
}
.hidebtn {
display: flex;
flex: 1;
justify-content: flex-end;
color: #75CA42;
font-size: 14px;
}
.hide {
word-break: break-word; //换行模式
overflow: hidden;
text-overflow: ellipsis; //修剪文字
display: -webkit-box;
-webkit-line-clamp: 3; //此处为上限行数
-webkit-box-orient: vertical;
}
</style>