zoukankan      html  css  js  c++  java
  • Vue实现左侧可伸缩

    <template>
     <div class="main">
      <div class="left_main" :class="{ left_main_show: !openStatus }"></div>
      <div class="right_main">
       <div class="open_close">
        <i @click="change" v-if="open_close" class="el-icon-s-fold"></i>
        <i @click="change" v-else class="el-icon-s-unfold"></i>
       </div>
      </div>
     </div>
    </template>
    <script>
    export default {
     name: 'Home',
     data() {
      return {
       openStatus: true,
       open_close: true,
      }
     },
     methods: {
      change() {
       this.openStatus = !this.openStatus
       if (this.openStatus) {
        setTimeout(() => {
         this.open_close = true
        }, 1000)
       } else {
        setTimeout(() => {
         this.open_close = false
        }, 1000)
       }
      },
     },
    }
    </script>
    <style lang="scss" scoped>
    .main {
     display: flex;
     width: 100%;
     height: 100vh;
     .left_main {
      margin: 0;
      width: 300px;
      text-align: center;
      background-color: aquamarine;
      transition: width 1s;
     }
     .right_main {
      flex: 1;
      background-color: brown;
      position: relative;
      .open_close {
       position: absolute;
       left: 0;
       top: 0;
       color: white;
       font-size: 24px;
      }
     }
     .left_main_show {
      width: 0px;
     }
    }
    </style>

  • 相关阅读:
    定制可引导的iso镜像
    镜像封装
    nginx知识及nginx集群搭建
    注册系统服务
    安装pip
    获取硬件信息
    查看网卡信息
    python paramiko模块
    python pexpect模块
    python-nmap的使用
  • 原文地址:https://www.cnblogs.com/lyt520/p/15741374.html
Copyright © 2011-2022 走看看