效果图:
html
<view> <view >公告</view><view &#64;click&#61;"showMore"> {{isShow ? &#39;收起∧&#39;:&#39;查看更多∨&#39;}} </view>
</view><!-- 更多弹框 -->
<view ><view class&#61;"show-more" :class&#61;"[isShow ? &#39;show-more-click&#39; : &#39;&#39;]"><view v-if&#61;"isShowText">第1行文字</view><view v-if&#61;"isShowText">第2行文字</view><view v-if&#61;"isShowText">第3行文字</view><view v-if&#61;"isShowText">第4行文字</view><view v-if&#61;"isShowText">第5行文字</view><view v-if&#61;"isShowText">第6行文字</view></view>
</view>
css
.show-more{width:100%;height:2px;background-color: #4CD964;transition:height 1s;-moz-transition:height 1s; -webkit-transition:height 1s; -o-transition:height 1s;
}
.show-more-click{height:300px;
}
js
showMore(){this.isShow &#61; !this.isShowthis.isClick &#61; !this.isClickif(this.isShowText){setTimeout(()&#61;>{this.isShowText &#61; !this.isShowText},200)}else{setTimeout(()&#61;>{this.isShowText &#61; !this.isShowText},500)}}