<template>
    <div class="navbar"
         :class="{'open':isOpen, 'show':model === 'index' && scrollY !== 0}"
    >
        <div class="navbar-wrapper">
            <router-link to="/">

            </router-link>

            <div class="navbar-item-wrapper" @mouseenter="handelMouseOver"
                 @mouseleave.stop="handelMouseOut">
                <div class="navbar-item" v-for="item in navbarList">
                    <router-link :to="item.path">
                        <a class="navbar-item-link" @mouseenter.stop="handelLineOver"
                           @mouseleave.stop="handelLineOut">
                            {{item.meta.title}}
                            <span class="line motion"></span>
                        </a>
                    </router-link>
<!--                    <dl class="navbar-item-detail-wrapper">-->
<!--                        <dd v-for="ii in item.children">-->
<!--                            <router-link :to="ii.path">-->
<!--                                <a>{{ii.meta.title}}</a>-->
<!--                            </router-link>-->
<!--                        </dd>-->
<!--                    </dl>-->
                </div>

            </div>
<!--            <div class="header-bg motion">-->
<!--                <div class="write-bg"></div>-->
<!--            </div>-->
        </div>
        <slot name="bg-content"></slot>
        <div class="shadow"></div>
    </div>
</template>

<script>
  export default {
    name: 'navbar',
    props: {
      // navbar模式 (default | index)
      model: {
        type: String,
        default: 'default'
      },
      // navbar的list
      navbarList: {
        type: Array,
        required: true
      }
    },
    data() {
      return {
        isOpen: true,
        time: 0,
        scrollY: 0
      }
    },
    mounted() {
         this.init()
         this.isOpen=true
		 
		 
    },
    methods: {
      init() {
        //添加鼠标滚动监听事件

      },
      handelScroll() {
        // 页面滚动距顶部距离

      },
      //控制鼠标悬停出现dl
      handelMouseOver(e) {


      },
      handelMouseOut(e) {

      },
      //控制鼠标悬停底部动画
      handelLineOver(e) {

      },
      handelLineOut(e) {

      }
    }
  }
</script>

<style lang="less" scoped>
    @import url('./navbar.less');
</style>
