<template>
  <div class="home">
    <nav-header />
    <div class="main-container">
      <!-- <component-main/> -->
      <router-view></router-view>
    </div>
    <component-footer />
    <div class="izl-rmenu">
      <a class="consult" target="_blank">
          <div class="phone" style="display:none;">400-835-2358</div>
      </a>
      <!-- <a class="cart"><div class="pic"></div></a> -->
      <a href="javascript:void(0)" class="btn_top" style="display: block;"></a>
    </div>
  </div>
</template>
<script>
import NavHeader from './layout/NavHeader.vue';
// import ComponentMain from './layout/ComponentMain.vue';
import ComponentFooter from './layout/ComponentFooter.vue';

export default {
  name: 'ComponentHome',
  components: {
    NavHeader,
    // ComponentMain,
    ComponentFooter
  },
  mounted() {
    $(".btn_top").hide();
    $(".btn_top").on("click",function(){
        console.log('点我到顶-----')
        $('html, body').animate({scrollTop: 0},300);return false;
    })
    $(window).bind('scroll resize',function(){
        if($(window).scrollTop()<=300){
            $(".btn_top").hide();
        }else{
            $(".btn_top").show();
        }
    })
  }
}
</script>
<style scoped>
.home {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.main-container {
  flex-grow: 1;
}
</style>
