<template>
	<div class="top-nav" :style_="topNavStyle">
		<span class="icon" v-show="topNavStyle === '2'" @click="onBack">
			<svg-icon name="back" size="18" />
		</span>
		<p class="division"></p>
		<my-info />
	</div>
</template>

<script setup lang="ts">
	import MyInfo from '@/components/MyInfo.vue'
	import { computed, ref } from 'vue'
	import { useRoute, useRouter } from 'vue-router'
	const route = useRoute()
	const topNavStyle = computed(() => route.meta.topNavStyle)
	const router = useRouter()
	const onBack = () => {
		router.back()
	}
</script>

<style lang="less" scoped>
	.top-nav {
		height: 8rem;
		display: flex;
		align-items: center;
		padding: 0 2rem 0 3rem;
		&[style_='1'] {
			border-bottom: 1px solid rgba(201, 201, 201, 1);
		}
		&[style_='2'] {
			border-bottom: 1px solid rgba(201, 201, 201, 1);
			background-color: #fff;
		}
		> .division {
			margin: auto;
		}
		> .icon {
			cursor: pointer;
			width: 2.4rem;
			height: 2.4rem;
		}
	}
</style>
