<template>
  <view class="navigator">
    <slot name="left"></slot>
    <view v-if="porps.isShowBack" class="back" @click="goBack">
      <image src="@/static/4.png"></image>
    </view>
    <view class="title">{{ porps.title }}</view>
    <slot name="right"></slot>
  </view>
</template>
<script lang="ts" setup>
const porps = defineProps({
  title: {
    type: String,
    default: ''
  },
  isShowBack: {
    type: Boolean,
    default: true
  }
})
const goBack = () => {
  uni.navigateBack({})
}
</script>
<style lang="scss" scoped>
.navigator {
  height: 3.13rem;
  // background-color: #fff;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.back {
  position: absolute;
  left: 0;
  height: 100%;
  padding-left: 1.0625rem;
  display: flex;
  align-items: center;
  image {
    width: 0.625rem;
    height: 1.0547rem;
  }
}
.title {
  font-size: 0.9375rem;
  color: #fff;
}
</style>
