<template>
  <div>
    <div class="m-header ng-scope">
      <div class="p-wrap-full tc" @click="goto('/')">
        <span class="logo " style="color: white;font-size: 36px;">
          {{config.title}}  </span>
      </div>
    </div>

    <div class="m-nav">
      <div class="p-wrap-full clear">
        <div class="nav-bd">
          <a v-for="(item, index) in navList" :key="index"
             :class="{ current: isActive(item) }"
             @click="goto(item.path)"
             v-if="!item.hidden">
            {{ item.name }}
          </a>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        config: window.baseConfig,
        navList: [
          { name: '首页', path: '/' },
          { name: '证书查询', path: '/fj-certificate' },
          { name: '学时认证', path: '/nd-sign' },
          { name: '文件通知', path: '/main/postlist/notice' },
        ]
      };
    },
    methods:{
      isActive(item) {
        return this.$route.path === item.path
      },
      goto( path ){
        if( this.$route.path != path){
          this.$router.push({path})
        }
      }
    }
  }
</script>

<style lang="less">
  @import "./navbar.less";
</style>
