<template>
  <div class="navbar" v-if="!is">
    <div class="ct df ai-c pl16 pr16">
      <van-icon name="arrow-left" size="18" color="#333333" @click="prev" />
    </div>
    <div class="slot"></div>
  </div>
</template>
<script lang="ts">
import { defineComponent, ref } from "vue";
import { useRoute, useRouter } from "vue-router";
export default defineComponent({
  setup() {
    const router = useRouter();
    const route = useRoute();
    const is = ref(false);

    is.value = !!route.query.is;

    const $_prev = () => {
      router.go(-1);
    };

    return { is, prev: $_prev };
  }
});
</script>
<style lang="scss" scoped>
.navbar {
  .ct {
    height: 44px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: white;
    z-index: 999;
  }
  .slot {
    height: 44px;
    width: 100%;
  }
}
</style>
