sign-stream/src/components/operateTitle/index.vue
2024-09-11 10:00:41 +08:00

76 lines
1.4 KiB
Vue

<script setup>
import { useRouter } from 'vue-router';
import { useRoute } from 'vue-router';
import { watch } from "vue";
const router = useRouter();
const goBack = () => {
router.go(-1)
}
const route = useRoute();
watch(route, () => {
if (route.path.includes('page-forward/upload-id-card')) {
switch (route.params.active) {
case '0':
route.meta.title = '上传身份证照片'
break;
case '1':
route.meta.title = '添加近照和通讯信息'
break;
case '2':
route.meta.title = '上传作品'
break;
case '3':
route.meta.title = '完成登记'
break;
}
}
/* document.title= route.meta.title*/
}, {
immediate: true
})
</script>
<template>
<div class="container1">
<div class="content1"
@click="goBack">
<img src="@/assets/images/back@3x.png" />
</div>
<div class="content2">{{ route.meta.title }}</div>
</div>
</template>
<style scoped lang="scss">
.container1 {
background: #000;
width: 375px;
height: 44px;
position: relative;
.content2 {
font-size: 14px;
color: #fff;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.content1 {
left: 16px;
top: 50%;
transform: translateY(-50%);
position: absolute;
img {
width: 12px;
height: 24px;
}
}
}
</style>