zoukankan      html  css  js  c++  java
  • Vue可伸缩工具栏

    <template>
     <div class="main">
      <div class="toolbar" :class="{ toolbar_show: !openStatus }">
       <el-button type="primary" size="small">点击</el-button>
       <el-button type="primary" size="small">点击</el-button>
       <el-button type="primary" size="small">点击</el-button>
       <el-button type="primary" size="small">点击</el-button>
       <el-button type="primary" size="small">点击</el-button>
       <el-button type="primary" size="small">点击</el-button>
       <el-button type="primary" size="small">点击</el-button>
      </div>
      <i @click="change" v-if="fold_unfold" class="el-icon-s-fold" style="font-size:42px;"></i>
      <i @click="change" v-else class="el-icon-s-unfold" style="font-size:42px;"></i>
     </div>
    </template>
    <script>
    export default {
     name: 'Always',
     data() {
      return {
       openStatus: false,
       fold_unfold: false,
      }
     },
     methods: {
      change() {
       if (this.openStatus) {
        setTimeout(() => {
         this.fold_unfold = false
        }, 1000)
       } else {
        setTimeout(() => {
         this.fold_unfold = true
        }, 1000)
       }
       this.openStatus = !this.openStatus
      },
     },
    }
    </script>
    <style lang="scss" scoped>
    .main {
     display: flex;
     .toolbar {
      width: 500px;
      height: 32px;
      padding: 5px 0;
      background-color: pink;
      transition: width 1s;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
     }
     .toolbar_show {
      width: 0px;
     }
    }
    </style>

  • 相关阅读:
    函数的设计和使用
    python正则表达式
    Python字符串
    Python序列(十一)集合
    centos 磁盘分区、格式化及挂载
    Nginx下配置SSL证书 调转到IIS、tomcat二级站点
    Mime 类型列表
    WCF学习- 体系结构
    .NET Framework Client Profile 简介
    WCF学习- 基础概念
  • 原文地址:https://www.cnblogs.com/lyt520/p/15741464.html
Copyright © 2011-2022 走看看