heyujie
2021-04-29 18dfd3d183e68db6306b34500813cca8f8c689c9
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
<template>
  <div class="switch-bar">
    <div class="name">{{ barName }}</div>
    <el-switch
      v-model="value"
      active-color="rgba(61, 104, 225, 1)"
      @change="switchChange"
    >
    </el-switch>
  </div>
</template>
 
<script>
export default {
  data() {
    return {
      // value: false,
    };
  },
  props: ["barName","value"],
  methods: {
    switchChange(val) {
      this.$emit("switchChange",val);
    },
  },
};
</script>
<style lang="scss">
.switch-bar {
  display: flex;
  align-items: center;
  height: 50px;
  padding: 0 25px;
  background-color: rgba(248, 248, 248, 1);
  justify-content: space-between;
  border-radius: 12px;
  margin-bottom: 10px;
  .name {
    font-size: 14px;
  }
}
</style>