var tmpl=`
<div class="navitems">
    <el-menu
    :default-active="navKey"
    class="el-menu-demo"
    mode="horizontal"
    @select="navRoute"
    background-color="#1e1e28"
    text-color="#b5b5b5"
    active-text-color="#ffd04b">
    <template v-for="(item,key) in navarr">
        <el-menu-item v-if="!item.obj" :index="item.name">{{item.name}}</el-menu-item>
        <el-submenu v-if="item.obj" :index="item.name">
            <template slot="title">{{item.name}}</template>
            <el-menu-item v-for="(list,index) in item.obj" :index="list">{{list}}</el-menu-item>
        </el-submenu>
    </template>
    </el-menu>
</div>

`
module.exports=
`{
   template:'${tmpl}',
   model:{

   },
   props:['navarr'],
   data:function(){
     return {
         navKey:null,
         navarr:this.navarr,
     };
   },
   mounted:function(){

   },
   watch:{

   },
   created:function(){

   },
   methods:{
       navRoute(key, keyPath) {
           this.$emit("navroute",key);
           console.log(key, keyPath);
       }
   },
   vname:"gsb-nav"
}`