zoukankan      html  css  js  c++  java
  • uni-app中,固定宽高,文字超出部分,隐藏并显示省略号。


    .topic_cont_text{ padding: 30upx; colof: #
    999; background: #E1FFFF; max-height: 130upx; overflow: hidden; word-break: break-all; /* break-all(允许在单词内换行。) */ text-overflow: ellipsis; /* 超出部分省略号 */ display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/ -webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/ -webkit-line-clamp: 2; /** 显示的行数 **/ }
    <view class="topic_content">
        <view class="topic_cont_text">
            <template v-if="showText">
                {{topicDetail.description}}
                <text v-if="topicDetail.description !== null && topicDetail.description.length > 140" class="full_text" @click="toggleDescription">收起</text>
            </template>
            <template v-else>
                {{topicDetail.description.substr(0, 140)}}
                <text v-if="topicDetail.description !== null && topicDetail.description.length > 140" class="full_text" @click="toggleDescription">全文</text>
            </template>
        </view>
    </view>
    
    // 全文展开收起
    toggleDescription (num) {
        this.showText = !this.showText
    }, 

    转载:https://blog.csdn.net/qq_41287423/article/details/98597276

  • 相关阅读:
    构建之法读书笔记04
    团队冲刺06
    12.23——周总
    团队冲刺05
    团队冲刺04
    用户场景分析
    团队冲刺03
    返回一个二维数组中最大联通子数组的和
    团队冲刺02
    FFT/NTT基础题总结
  • 原文地址:https://www.cnblogs.com/aknife/p/12780167.html
Copyright © 2011-2022 走看看