<template>
  <div class="header" :style="transparent ? '' : 'background-color: #ffffff;'">
    <m-icon type="fanhui" @click="onClickLeft" />
    <span class="title">{{ title }}</span>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from "vue-router";
const props = defineProps({
  title: String,
  transparent: Boolean,
});
const router = useRouter();
const onClickLeft = () => {
  router.back();
};
</script>

<style lang="scss" scoped>
.header {
  position: sticky;
  top: 0;
  font-size: 15px;
  padding: 15px;
  z-index: 999;
  .title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
}
</style>
