效果图在这里插入图片描述

代码

	<view :class="brandFold?'div1':'div2'"></view>
	<view @click="changeFoldState" style="position: relative;bottom: 0;">
		展开/收起
	</view&gt;
	brandFold:true

	changeFoldState() {
	  this.brandFold = !this.brandFold;
	},
	.div1{
		height: 100px;
		overflow: hidden;
		transition: height .3s;
		background: red;
	}
	.div2{
		height: 360px;		
		transition: height .3s;
		background: pink;
	}

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注