tanghaolin
2023-01-11 9a4868a948e46fb4e4a5bd0de82ceb008a7cd179
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!--  -->
<template>
  <div class="tab_bg" @click="$emit('ok',title)" :style="`background-image:url(${currentimg})`">
    <div class="title" :style="`color:${active?'coral':'#fff'}`" >{{ title }}</div>
  </div>
</template>
 
<script>
import defaultimg from "@/assets/images/tab_btn_bg.png"
import activeimg from "@/assets/images/tab_btn_bg_active.png"
export default {
  name: "tabBtn",
  components: {},
  props: {
    title: {
      type: String,
      default: "按钮",
    },
    active: {
      type: Boolean,
      default: false,
    },
    tabs:{
      type:Array,
      require:true,
    }
  },
  data() {
    return {};
  },
  created() {},
  mounted() {
    // console.log(this.active,27)
  },
  computed: {
    currentimg(){
      return this.active?activeimg:defaultimg
    }
  },
  watch: {},
  methods: {},
};
</script>
<style scoped>
.tab_bg {
  width: 150px;
  height: 60px;
  background: url("../assets/images/tab_btn_bg.png") no-repeat;
  background-size: 100% 100%;
  margin: 0 20px;
  display: inline-block;
  cursor: pointer;
}
 
.tab_bg .title {
  width: 150px;
  height: 60px;
  line-height: 60px;
  text-align: center;
  font-size: 24px;
  color: coral;
}
 
</style>