appsnbcbweicheng 1.2.24 → 1.2.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appsnbcbweicheng",
3
- "version": "1.2.24",
3
+ "version": "1.2.26",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,83 @@
1
+ <template>
2
+ <div class="expand-text">
3
+ <div ref="text" :class="['text-content', { clamp: !expanded }]">
4
+ {{ text }}
5
+ </div>
6
+
7
+ <span v-if="showToggle" class="toggle-btn" @click="toggle">
8
+ {{ expanded ? "收起" : "展开" }}
9
+ </span>
10
+ </div>
11
+ </template>
12
+
13
+ <script>
14
+ export default {
15
+ name: "ExpandText",
16
+
17
+ props: {
18
+ text: {
19
+ type: String,
20
+ default: ""
21
+ }
22
+ },
23
+
24
+ data() {
25
+ return {
26
+ expanded: false,
27
+ showToggle: false
28
+ }
29
+ },
30
+
31
+ mounted() {
32
+ this.checkOverflow()
33
+ },
34
+
35
+ watch: {
36
+ text() {
37
+ this.$nextTick(() => {
38
+ this.checkOverflow()
39
+ })
40
+ }
41
+ },
42
+
43
+ methods: {
44
+ checkOverflow() {
45
+ const el = this.$refs.text
46
+
47
+ if (!el) return
48
+
49
+ this.showToggle = el.scrollHeight > el.clientHeight
50
+ },
51
+
52
+ toggle() {
53
+ this.expanded = !this.expanded
54
+ }
55
+ }
56
+ }
57
+ </script>
58
+
59
+ <style scoped>
60
+ .expand-text {
61
+ position: relative;
62
+ }
63
+
64
+ .text-content {
65
+ word-break: break-word;
66
+ line-height: 20px;
67
+ }
68
+
69
+ /* 三行限制 */
70
+ .clamp {
71
+ display: -webkit-box;
72
+ -webkit-line-clamp: 3;
73
+ -webkit-box-orient: vertical;
74
+ overflow: hidden;
75
+ }
76
+
77
+ .toggle-btn {
78
+ color: #409eff;
79
+ cursor: pointer;
80
+ font-size: 12px;
81
+ margin-left: 6px;
82
+ }
83
+ </style>
package/readme.md CHANGED
@@ -1,3 +1,5 @@
1
+ 1.2.26 投研平台
2
+ 1.2.25 投研平台
1
3
  1.2.24 投研平台
2
4
  1.2.23 投研平台
3
5
  1.2.22 数据核对