whychdw
2025-06-06 d0f98ad8e1047e3161a458399ad3005404ed87b8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<script setup>
const props = defineProps({
  active: {
    type: Boolean,
    default: false
  }
});
</script>
 
<template>
  <div class="tab-button-wrapper" :class="{'active': active}">
    <slot></slot>
  </div>
</template>
 
<style scoped lang="less">
.tab-button-wrapper {
  display: inline-block;
  user-select: none;
  padding: 12px 48px;
  text-align: center;
  background-image: url("./images/bg.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  cursor: pointer;
  font-size: 16px;
  &:hover {
    font-weight: 700;
  }
  &:active {
    background-image: url("./images/active-bg.png");
  }
  &.active {
    background-image: url("./images/active-bg.png");
  }
}
</style>