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>

  • 相关阅读:
    firewall详解
    Fiddler使用
    Asp.net Core过滤器
    单例模式
    C# 收银机顾显(客显)及打印小票(58热敏打印机)
    sqlite批量处理数据性能优化
    sqlite 插入数据 too many variables
    winform textbox控件keydown、keypress、keyup简单介绍
    ie兼容placeholder效果
    asp.net mvc全局异常捕获
  • 原文地址:https://www.cnblogs.com/lyt520/p/15741464.html
Copyright © 2011-2022 走看看