hookehuyr

荣誉展示的文本高度调整

1 <!-- 1 <!--
2 * @Date: 2024-10-17 11:13:44 2 * @Date: 2024-10-17 11:13:44
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-10-24 14:19:29 4 + * @LastEditTime: 2024-10-24 15:24:20
5 * @FilePath: /hager/src/views/about/honors.vue 5 * @FilePath: /hager/src/views/about/honors.vue
6 * @Description: 关于海格-荣誉展示 6 * @Description: 关于海格-荣誉展示
7 --> 7 -->
...@@ -40,9 +40,9 @@ ...@@ -40,9 +40,9 @@
40 <div class="card-image-box"> 40 <div class="card-image-box">
41 <div class="card-image" :style="{ backgroundImage: `url(${x.cover})` }"></div> 41 <div class="card-image" :style="{ backgroundImage: `url(${x.cover})` }"></div>
42 </div> 42 </div>
43 - <div ref="contentDiv" class="card-content"> 43 + <div class="card-content">
44 <h3>{{ x.post_title }}</h3> 44 <h3>{{ x.post_title }}</h3>
45 - <p v-html="x.post_content"></p> 45 + <p ref="contentDiv" v-if="x.post_content">{{ x.post_content }}</p>
46 </div> 46 </div>
47 </div> 47 </div>
48 </div> 48 </div>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
62 </div> 62 </div>
63 <div class="card-content xs"> 63 <div class="card-content xs">
64 <h3>{{ x.post_title }}</h3> 64 <h3>{{ x.post_title }}</h3>
65 - <p v-html="x.post_content"></p> 65 + <p v-if="x.post_content" class="content">{{ x.post_content }}</p>
66 </div> 66 </div>
67 </div> 67 </div>
68 </div> 68 </div>
...@@ -270,24 +270,27 @@ export default { ...@@ -270,24 +270,27 @@ export default {
270 .card-image { 270 .card-image {
271 width: 100%; 271 width: 100%;
272 height: 17rem; 272 height: 17rem;
273 - background-size: contain; 273 + background-size: cover;
274 background-position: center; 274 background-position: center;
275 background-repeat: no-repeat; 275 background-repeat: no-repeat;
276 } 276 }
277 .card-content { 277 .card-content {
278 background-color: #F7F7F7; 278 background-color: #F7F7F7;
279 padding: 2rem 1.5rem; 279 padding: 2rem 1.5rem;
280 - height: 12rem; 280 + padding-bottom: 0.5rem;
281 - overflow: scroll;
282 h3 { 281 h3 {
283 color: @secondary-color; 282 color: @secondary-color;
284 font-size: 1rem; 283 font-size: 1rem;
285 margin: 0; 284 margin: 0;
286 - margin-bottom: 0.5rem; 285 + height: 3rem;
286 + line-height: 1.5;
287 } 287 }
288 p { 288 p {
289 font-size: 0.95rem; 289 font-size: 0.95rem;
290 line-height: 1.8; 290 line-height: 1.8;
291 + height: 8rem;
292 + margin-bottom: 0.5rem;
293 + overflow: scroll;
291 } 294 }
292 } 295 }
293 } 296 }
...@@ -347,20 +350,22 @@ export default { ...@@ -347,20 +350,22 @@ export default {
347 .card-content { 350 .card-content {
348 background-color: #F7F7F7; 351 background-color: #F7F7F7;
349 padding: 2rem 1.5rem; 352 padding: 2rem 1.5rem;
350 - height: 12rem;
351 - overflow: scroll;
352 &.xs { 353 &.xs {
353 - height: 7rem; 354 + // height: 2rem;
355 + padding-bottom: 0.5rem;
354 } 356 }
355 h3 { 357 h3 {
356 color: @secondary-color; 358 color: @secondary-color;
357 font-size: 1rem; 359 font-size: 1rem;
358 margin: 0; 360 margin: 0;
359 margin-bottom: 0.5rem; 361 margin-bottom: 0.5rem;
362 + height: 3rem;
360 } 363 }
361 p { 364 p {
362 font-size: 0.95rem; 365 font-size: 0.95rem;
363 line-height: 1.8; 366 line-height: 1.8;
367 + height: 8rem;
368 + overflow: scroll;
364 } 369 }
365 } 370 }
366 } 371 }
......