<template>
  <div class="grading-set">
    <div class="page-navs">
      <Button
        :type="curNav.name === nav.name ? 'primary' : 'default'"
        v-for="(nav, index) in navs"
        :key="index"
        @click="switchNav(nav)"
        >{{ nav.title }}</Button
      >
    </div>

    <router-view />
  </div>
</template>

<script>
import { gradingSetNavs } from "@/routers/main";
import menuMixins from "@/components/homeMenuMixins";

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