hide show vue 动画_vue结合elementUI折叠展开效果动画

这篇博客探讨了如何在Vue应用中使用ElementUI的`el-collapse-transition`组件来实现折叠和展开的动画效果。通过示例代码展示了如何在点击标题时切换背景颜色,并在`tabTitle`数据中管理当前选中的标题。文章还提到了一个疑问,即点击左边的组件并未影响到右边的组件,作者对此感到困惑。
摘要由CSDN通过智能技术生成

组件

  • v-for="(title,index) in tabTitle"

    :key="index"

    @click="getclcik(index)"

    class="menu-li"

    :class="{active:cur==index}"

    >{{title}}

1211111111111111111111111111111111

export default {

data() {

return {

tabTitle: ['标题一', '标题二', '标题三', '标题四'],

cur: 0, //默认选中第一个tab

show3: true

}

},

methods: {

getclcik(value) {

this.cur = value;

},

handlerThe() {

this.show3 = !this.show3;

}

}

}

.hide-page-com {

background: #ffffff;

border-radius: 10px;

}

.tab-tilte {

display: flex;

height: 56px;

align-items: center;

padding-left: 24px;

}

.menu-li {

padding: 10px 0;

text-align: center;

cursor: pointer;

margin-right: 28px;

}

/* 点击对应的标题添加对应的背景颜色 */

.active {

color: #09f;

border-bottom: 2px solid #09f;

}

.tab-content div {

line-height: 100px;

text-align: center;

}

.right-part {

flex: 1;//右边区域自动适应

text-align: right;

padding-right: 20px;

}

.cont-cont {

padding-left: 24px;

padding-right: 36px;

display: flex;

flex-direction: column;

justify-content: space-between;

.item-list-cont {

height: 36px;

line-height: 36px;

}

}

// 两个模块各占50%(重点)

// 如果想让两个模块中间有间距 直接最后一个模块 margin-left: 20px;(了解)

使用页面

export default {

data() {

return {

}

},

components: {

'com-box': () => import('./com')

}

}

.index-page {

height: 100%;

background: #ccc;

.flex-block {

display: flex;

}

.half {

width: 50%;

}

.lefthale {

margin-left: 20px;

}

}

动画使用了elementUi中的。

collapse 展开折叠

使用 el-collapse-transition 组件实现折叠展开效果。

我疑惑的是为啥组件中没有互相影响。

我点击左边的 应该会影响右边的组件啊

但是却没有 不晓得为啥子

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值