Files
ylst-h5/src/layouts/index.vue
liu.huiying@ebiz-digits.com 448f69a880 feat:获取token
2025-03-17 11:15:22 +08:00

54 lines
1.1 KiB
Vue

<template>
<div class="common-layout">
<!-- title 标题和搜索栏 -->
<header class="header">
<van-nav-bar :title="$route.meta.title" left-arrow safe-area-inset-top @click-left="goBack">
<template #left>
<img src="@/assets/img/back.png" alt="" class="back-icon" />
</template>
</van-nav-bar>
</header>
<!-- content -->
<RouterView />
</div>
</template>
<script setup>
import { RouterView, useRouter, useRoute } from 'vue-router';
import appBridge from '@/assets/js/appBridge';
const route = useRoute();
const router = useRouter();
function goBack () {
if (window.history.length > 1 && route.meta.title !== '伊调研') {
router.go(-1);
} else {
appBridge.navigateBack();
}
}
</script>
<style scoped lang="scss">
.common-layout {
background-color: white;
color: #333;
}
.header {
position: sticky;
top: 0;
z-index: 1000;
background-color: #a5d380;
.title {
display: flex;
align-items: end;
justify-content: center;
}
.back-icon {
width: 18px;
height: 18px;
}
}
</style>