<template>
  <div class="inspection home">
    <div class="home-header">
      <view-header>
        <div class="home-navs" slot="info">
          <ul>
            <li
              :class="{ act: curNav.name === nav.name }"
              v-for="(nav, index) in navs"
              :key="index"
              @click="switchNav(nav)"
            >
              <span class="nav-item-cont">{{ nav.title }}</span>
            </li>
          </ul>
        </div>
      </view-header>
    </div>

    <div class="home-body">
      <div class="home-main">
        <router-view />
      </div>
    </div>
  </div>
</template>

<script>
import { navs } from "@/routers/inspection";
import menuMixins from "@/components/homeMenuMixins";

export default {
  name: "inspection",
  mixins: [menuMixins],
  data() {
    return { navs, curNav: {} };
  },
  watch: {
    $route: {
      handler(val) {
        this.actCurNav(val);
      }
    }
  },
  mounted() {
    this.actCurNav(this.$route);
  }
};
</script>
