vue3 数据可视化大屏tab组件-蓝色菱形tab按钮

vue3 数据可视化大屏 项目开发中,会需要一些tab切换组件,虽然已经有一些现成的组件了,这里整理的是vue3 数据可视化大屏tab组件-蓝色菱形tab按钮。

vue3 数据可视化大屏tab组件-蓝色菱形tab按钮

vue3 数据可视化大屏tab组件-蓝色菱形tab按钮-左倾斜按钮

vue3 数据可视化大屏tab组件-蓝色菱形tab按钮-左倾斜按钮

vue3 数据可视化大屏tab组件-蓝色菱形tab按钮-右倾斜按钮

vue3 数据可视化大屏tab组件-蓝色菱形tab按钮-右倾斜按钮

使用组件

/**
* @Author: 858834013@qq.com
* @Name: tab
* @Date: 2023年06月21日15:59:38
* @Desc: tab
*/
<template>
  <div class="tabs">
    <tab v-model:active="active" :list="navList"></tab>
  </div>
</template>
<script>
import tab from './tab.vue'

export default {
  name: "tabs",
  components: {tab},
  data() {
    return {
      active: '0',
      navList: [{
        name: '综合态势',
        id: '0'
      }, {
        name: '园区设施',
        id: '1'
      }]
    }
  },
}
</script>
<style scoped lang="scss">
.tabs {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: nowrap;
  flex-direction: row;
  width: calc(100% - 40px);
  margin: 10px auto;
}
</style>

tab按钮样式

/**
* @Author: 858834013@qq.com
* @Name: tab
* @Date: 2023年06月21日15:46:58
* @Desc: tab组件
*/
<template>
  <div class="tabs">
    <div class="tab cur" :class="{active:active==item.id}" @click="getactive(item.id)" v-for="(item,index) in list"
         :key="index">
      <span>{{ item.name }}</span>
      <bg :class="{active:active==item.id}"></bg>
    </div>
  </div>
</template>
<script>
import bg from './bg.vue'

export default {
  name: "tabs",
  components: {bg},
  props: {
    list: {
      type: Array,
      default() {
        return [];
      }
    },
    active: {
      type: [Number, String],
      default() {
        return 0;
      }
    },
  },
  data() {
    return {}
  },
  watch: {},
  mounted() {
  },
  methods: {
    getactive(e) {
      this.$emit('update:active', e)
    },
  }
}
</script>
<style scoped lang="scss">
.tabs {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: nowrap;
  flex-direction: row;

  .tab {
    min-width: 84px;
    height: 32px;
    opacity: 1;
    display: flex;
    cursor: pointer;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    flex-direction: row;
    align-content: flex-start;
    margin-right: 10px;
    position: relative;

    span {
      font-size: 14px;
      font-family: PingFang;
      font-weight: 500;
      color: rgba(214, 238, 255, 1);
      padding: 0 20px;
    }
  }

  .tab.active {
    span {
      opacity: 1;
      color: rgba(214, 238, 255, 1);
    }
  }
}
</style>

背景按钮

/**
* @Author: 858834013@qq.com
* @Name: tab
* @Date: 2023年06月21日15:47:24
* @Desc: bg
*/
<template>
  <div class="bg">
    <div class="bg1"></div>
    <div class="bg2"></div>
    <div class="bg3"></div>
  </div>
</template>
<script>
export default {
  name: "tabs",
  components: {},
  props: {
    list: {
      type: Array,
      default() {
        return [];
      }
    },
    active: {
      type: [Number, String],
      default() {
        return 0;
      }
    },
  },
  data() {
    return {}
  },
  watch: {},
  mounted() {
  },
  methods: {
    getactive(e) {
      this.$emit('update:active', e)
    },
  }
}
</script>
<style scoped lang="scss">
.bg {
  width: 100%;
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  flex-direction: row;
  align-content: flex-start;
  height: 100%;
  z-index: -1;

  .bg1 {
    background: url("./assets/tabbg1.png");
    width: 14px;
    height: 100%;
    position: relative;
    background-size: 100% 100%;
  }

  .bg2 {
    background: url("./assets/tabbg2.png");
    width: calc(100% - 14px - 14px);
    height: 100%;
    position: relative;
    background-size: 100% 100%;
  }

  .bg3 {
    background: url("./assets/tabbg3.png");
    width: 14px;
    height: 100%;
    position: relative;
    background-size: 100% 100%;
  }
}

.bg:hover,.bg.active {
  width: 100%;
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  flex-direction: row;
  align-content: flex-start;
  height: 100%;

  .bg1 {
    background: url("./assets/tabActivebg1.png");
    width: 14px;
    height: 100%;
    position: relative;
    background-size: 100% 100%;
  }

  .bg2 {
    background: url("./assets/tabActivebg2.png");
    width: calc(100% - 14px - 14px);
    height: 100%;
    position: relative;
    background-size: 100% 100%;
  }

  .bg3 {
    background: url("./assets/tabActivebg3.png");
    width: 14px;
    height: 100%;
    position: relative;
    background-size: 100% 100%;
  }
}
</style>

vue3 数据可视化大屏tab ui组件汇总整合

vue3 数据可视化大屏tab ui组件汇总整合

源文件下载

效果代码 vue3 vite js nodejs 14

相关文件下载地址
此资源需支付 ¥1 后下载
支付宝购买扫右侧红包码购买更优惠,如无法下载请联系微信:17331886870
喜欢
vue3 数据可视化大屏tab组件-蓝色菱形tab按钮