0
点赞
收藏
分享

微信扫一扫

vue js 多组件异步请求解决方案

kmoon_b426 2024-08-14 阅读 26

未展开全部:

展开全部:

综上演示按钮始终保持在最下方

css代码如下:

<div class="info-content">
	<div class="info-text" :class="!showAll ? 'mle-hidden' : ''">
		<span class="show-all" @click="handleShowAll">
			{{ showAll ? "收起" : "展开" }}
            <span class="arrow" :class="showAll ? 'active' : ''"></span>
		</span>
	    【预置内容】质量标签信息内容信息质量标签内容质量标签信息内容信息质量标签内容
	</div>
</div>

css代码如下:

.info-content {
	padding: 10px 0;
	margin: 0 16px;
	display: flex;
	.info-text {
		font-weight: 400;
		font-size: 14px;
		color: #919191;
		&:before {
			content: "";
			float: right;
			width: 0;
			height: calc(100% - 16px);
			background: red;
		}
		&.mle-hidden {
			display: -webkit-box;
			overflow: hidden;
			-webkit-box-orient: vertical;
			-webkit-line-clamp: 2;
		}
	    .show-all {
		    float: right;
		    clear: both;
		    font-weight: 500;
		    font-size: 14px;
		    color: #61afff;
		    cursor: pointer;
		    margin-top: -4px;
	        .arrow {
		        display: inline-block;
		        width: 6px;
		        height: 6px;
		        border-left: 2px solid #61afff;
		        border-bottom: 2px solid #61afff;
		        transform: translateY(-30%) rotate(-45deg);
		        margin: 0 4px;
		        transition: all ease-in-out 0.3s;
		        &.active {
			        transform: rotate(135deg);
		        }
	        }
        }
    }
}

最主要的是使用伪元素before把按钮顶下来,始终在最后一行

举报

相关推荐

0 条评论