<!--  -->
<template>
  <div class="nav-bar">
    <van-nav-bar
      :title="title"
      :left-text="leftText"
      :right-text="rightText"
      :left-arrow="leftArrow"
      @click-left="onClickLeft"
      @click-right="onClickRight"
    >
      <template #right><slot name="right"></slot> </template>
    </van-nav-bar>
  </div>
</template>

<script>
export default {
  name: 'NavBar',
  props: {
    title: {
      type: String,
      default: ''
    },
    leftText: {
      type: String,
      default: '' || '返回'
    },
    rightText: {
      type: String,
      default: ''
    },
    leftArrow: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {};
  },
  created() {},
  mounted() {},
  methods: {
    onClickLeft(value) {
      this.$emit('on-click-left', value);
    },
    onClickRight(value) {
      this.$emit('on-click-right', value);
    }
  }
};
</script>
<style lang="scss">
.nav-bar {
  position: fixed !important;
  left: 0;
  top: 0;
  height: 100px;
  width: 100%;
  z-index: 999;
  color: #333;
  .van-nav-bar {
    .van-nav-bar__content {
      .van-nav-bar__right {
        .van-nav-bar__text {
          color: #333;
        }
      }
    }
  }
}

/* @import url(); 引入css类 */
</style>
