<template>
  <div class="nav-bar-box">
    <van-nav-bar :title="Title" left-text="返回" left-arrow @click-left="onClickLeft">
      <div slot="right">
        <slot name="rightBtn"></slot>
      </div>
    </van-nav-bar>
  </div>
</template>

<script>
import { NavBar } from 'vant';

export default {
  name: "navbar",
  props: {
    Title: String,
    special:Boolean
  },
  data() {
    return {

    }
  },
  mounted() {

  },
  methods: {
    // 返回上一页
    onClickLeft() {
      if(this.special){
        this.$emit('handleClickLeft')
      }else{
        history.back();
      }
    },
  },
  components: {
    VanNavBar: NavBar,
  },
}
</script>

<style scoped>
.nav-bar-box{
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}
</style>