<template>
  <div class="nav-wrap">
    <van-nav-bar
      left-arrow
      :title="title"
      :border="false"
      fixed
      :placeholder="true"
      @click-left="onClickLeft"
    >
      <template #right>
        <slot></slot>
      </template>
    </van-nav-bar>
  </div>
</template>

<script setup>
import { defineProps } from "vue";
import { useRouter } from "vue-router";
defineProps({
  title: {
    required: true,
    type: String,
    default: "",
  },
});
const router = useRouter();
const onClickLeft = () => {
  router.back();
};
</script>
<style scoped lang="scss">
::v-deep .van-nav-bar--fixed {
  z-index: 2;
}
::v-deep .van-nav-bar {
  background: #f5f6f7;
}
::v-deep .van-nav-bar__left .van-icon {
  color: #333;
  font-size: 40px;
}
::v-deep .van-nav-bar__title {
  font-size: 38px;
  font-weight: 400;
}
.nav-wrap {
  position: relative;
  z-index: 5;
}
</style>
