sign-stream/src/components/operateTitle/index.vue

76 lines
1.4 KiB
Vue
Raw Normal View History

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