zhangzengfei
2022-07-20 4a800a8fc83c6bd1f86a8e847b079a51a7532c09
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<template>
  <div class="internet_data">
 
    <!-- 左侧tab栏 -->
    <div class="left_tab">
      <tab-single 
       v-for="(item,index) in tabArr"
       :id="index"
       :key="index"
       :icon="item.icon" 
       :title="item.title"
       :activeTab="activeTab"
       @click.native="toggleActive(index)"
      />
    </div>
 
    <!-- 右侧表格 -->
    <div class="right">
 
    <!-- 智能安全帽 -->
    <helmet
    />
 
    </div>
  </div>
</template>
 
<script>
import tabSingle from "../components/tabSingle.vue";
import helmet from '../views/helmet.vue'
export default {
  data (){
    return {
      // 左侧tab数据
      tabArr: [
      {icon: "\ue77f", title: "智能安全帽"},
      {icon: "\ue764", title: "温度传感器"},
      {icon: "\ue769", title: "其他传感器"}
      ],
      activeTab: 0
 
      // 
    }
  },
 
  components: {
    tabSingle,
    helmet
  },
 
  methods: {
    toggleActive(index) {
      this.activeTab = index
    }
  }
}
</script>
 
<style scoped lang="less">
* {
box-sizing: border-box;
}
 
.internet_data {
display: flex;
height: 100%;
background-color: #fff;
border-top: 1px solid #E0E0E0;
 
  .left_tab {
    padding: 20px;
    width: 230px;
    height: 100%;
 
    .tab_single {
      margin-bottom: 10px;
    }
  }
 
  .right {
    height: 100%;
    flex: 1;
  }
}
</style>