Vue可伸缩工具栏

<template>
 <div class="main">
  <div class="toolbar" :class="{ toolbar_show: !openStatus }">
   <el-button type="primary" size="default">点击</el-button>
  </div>
  <i @click="change" v-if="openStatus" class="el-icon-s-fold" style="font-size:52px;"></i>
  <i @click="change" v-else class="el-icon-s-unfold" style="font-size:52px;"></i>
 </div>
</template>
<script>
export default {
 data() {
  return {
   openStatus: true,
  }
 },
 methods: {
  change() {
   this.openStatus = !this.openStatus
  },
 },
}
</script>
<style lang="scss" scoped>
.main {
 display: flex;
 .toolbar {
  width: 200px;
  padding: 5px 0;
  background-color: pink;
  transition: width 1.5s;
  overflow: hidden;
 }
 .toolbar_show {
  width: 0px;
 }
}
</style>

Vue可伸缩工具栏

 Vue可伸缩工具栏

 

上一篇:iframe 另类知识


下一篇:直播带货平台开发,通过Toolbar实现顶部标题栏的效果