<template>
  <div :class="['toolbar',sidebarOpened ? 'ant-header-side-opened' : 'ant-header-side-closed', ]">
    <div style="float: left">
      <slot name="title"></slot>
    </div>
    <div style="float: right">
      <slot name="extra"></slot>
    </div>
  </div>
</template>

<script>
  import {mixin} from '@/util/mixin.js'

  export default {
    name: 'HeaderToolBar',
    mounted() {

    },
    mixins: [mixin]
  }
</script>

<style lang="less" scoped>
  .ant-spin-blur {
    .toolbar {
      top: 0px !important;
      background: transparent;
      &.ant-header-side-opened {
        width: calc(100%);
        background: transparent;
      }

      &.ant-header-side-closed {
        width: calc(100%);
        background: transparent;
      }
    }
  }

  .toolbar {
    position: fixed;
    top: 50px;
    height: 45px;
    line-height: 45px;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.03);
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    border-top: 1px solid #e8e8e8;
    padding: 0 18px;
    z-index: 9;

    &.ant-header-side-opened {
      width: calc(100% - 213px)
    }

    &.ant-header-side-closed {
      width: calc(100% - 80px)
    }
  }

  .layout.mobile .ant-header-side-opened, .layout.mobile .ant-header-side-closed {
    width: 100%
  }
</style>
