...
|
...
|
@@ -39,6 +39,7 @@ export default { |
|
|
watch: {
|
|
|
'data.intro': function() {
|
|
|
this.introHeight = 0;
|
|
|
this.introCollapseHeight = 0;
|
|
|
this.updateHeight();
|
|
|
}
|
|
|
},
|
...
|
...
|
@@ -47,8 +48,6 @@ export default { |
|
|
return (this.data.maxLines || MAX_LINES) - 1;
|
|
|
},
|
|
|
trimIntro() {
|
|
|
this.introHeight = 0;
|
|
|
this.introCollapseHeight = 0;
|
|
|
return trim(this.data.intro);
|
|
|
},
|
|
|
showIntro() {
|
...
|
...
|
@@ -61,12 +60,12 @@ export default { |
|
|
textArr[line] = textArr[line] || '';
|
|
|
textArr[line] += val;
|
|
|
|
|
|
if (textArr[line].length >= 24 || isEnter) {
|
|
|
if (textArr[line].length >= 21 || isEnter) {
|
|
|
line++;
|
|
|
}
|
|
|
|
|
|
if (line > this.maxLines) {
|
|
|
textArr[this.maxLines] = textArr[this.maxLines].substring(0, Math.min(21, textArr[this.maxLines].length));
|
|
|
textArr[this.maxLines] = textArr[this.maxLines].substring(0, Math.min(17, textArr[this.maxLines].length));
|
|
|
return false;
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -120,7 +119,7 @@ export default { |
|
|
methods: {
|
|
|
updateHeight() {
|
|
|
this.$nextTick(() => {
|
|
|
this.introHeight = get(this.$refs, 'introPool.scrollHeight', 0) + 20;
|
|
|
this.introHeight = get(this.$refs, 'introPool.scrollHeight', 0) + 22;
|
|
|
this.introCollapseHeight = get(this.$refs, 'intro.offsetHeight', 0);
|
|
|
});
|
|
|
},
|
...
|
...
|
@@ -130,7 +129,7 @@ export default { |
|
|
}
|
|
|
|
|
|
if (!this.canRetract) {
|
|
|
this.canRetract = this.introHeight - 21 > get(this.$refs, 'expand.offsetHeight', 0) * (this.maxLines + 4);
|
|
|
this.canRetract = this.introHeight - 23 > get(this.$refs, 'expand.offsetHeight', 0) * (this.maxLines + 4);
|
|
|
}
|
|
|
|
|
|
this.isIntroExpand = !this.isIntroExpand;
|
...
|
...
|
@@ -154,10 +153,9 @@ export default { |
|
|
transition: height 250ms cubic-bezier(0.165, 0.84, 0.44, 1);
|
|
|
|
|
|
.intro-content {
|
|
|
line-height: 48px;
|
|
|
font-size: 28px;
|
|
|
line-height: 1.7;
|
|
|
font-size: 32px;
|
|
|
color: #4a4a4a;
|
|
|
letter-spacing: 0.06PX;
|
|
|
box-sizing: content-box;
|
|
|
position: relative;
|
|
|
}
|
...
|
...
|
@@ -192,15 +190,16 @@ export default { |
|
|
.collapse {
|
|
|
width: 100%;
|
|
|
text-align: right;
|
|
|
font-size: 28px;
|
|
|
font-size: 32px;
|
|
|
color: #000;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
|
|
|
.expand {
|
|
|
font-size: 28px;
|
|
|
font-size: 32px;
|
|
|
color: #000;
|
|
|
line-height: 20px;
|
|
|
white-space: nowrap;
|
|
|
|
|
|
&.collapse {
|
|
|
position: absolute;
|
...
|
...
|
|