<template>
  <div class="global">
    <div class="mainContainer">
      <div class="tab">
        <el-tabs v-model="activeName" @tab-click="handleClick">
          <el-tab-pane label="最新安全巡查记录" name="NewSafe" />
          <el-tab-pane label="全部安全巡查记录" name="AllSafe" />

        </el-tabs>
      </div>
      <div id="main">

        <router-view id="mainRight" />
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'SafeTabs',
  data() {
    return {
      activeName: 'NewSafe'
    }
  },
  mounted() {
    this.activeName = this.$route.name
  },
  methods: {
    handleClick(tab, event) {
      console.log(tab, event)
      this.$router.push(tab.name)
    }
  }
}
</script>
