日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學(xué)無(wú)先后,達(dá)者為師

網(wǎng)站首頁(yè) 編程語(yǔ)言 正文

CSS點(diǎn)擊切換或隱藏盒子的卷起、展開(kāi)效果

作者:前端程序媛Ying 更新時(shí)間: 2023-10-13 編程語(yǔ)言

<template>
  <div class="main">
    <el-button @click="onCllick">切換</el-button>
    <transition name="slideDown">
      <div class="info" v-if="isShow">1111</div>
    </transition>
  </div>
</template>

<script lang="ts">
import { defineComponent, reactive, toRefs } from 'vue'
export default defineComponent({
  name: 'login-account ',
  components: {},
  setup(props, { emit, slots, attrs }) {
    const state = reactive({
      isShow: false
    })
    const onCllick = () => {
      console.log('切換')
      state.isShow = !state.isShow
    }
    return {
      ...toRefs(state),
      onCllick
    }
  }
})
</script>

<style lang="less">
.info {
  width: 100px;
  height: 400px;
  background-color: skyblue;
  margin: 0 auto;
}

.slideDown-enter-active,
.slideDown-leave-active {
  transition: all 0.5s ease-in-out;
}

.slideDown-enter-from {
  height: 0;
}

.slideDown-leave-to {
  height: 0;
}
</style>

原文鏈接:https://blog.csdn.net/m0_62323730/article/details/133658217

  • 上一篇:沒(méi)有了
  • 下一篇:沒(méi)有了
欄目分類(lèi)
最近更新