算是一个简单的返回页面
<template>
<div class="wechat-order-detail-container">
<navBar v-if="pageTitle" :page-title="pageTitle"></navBar>
</div>
</template>
<script setup>
import { ref } from "vue";
import Taro, { useDidShow } from "@tarojs/taro";
import navBar from "../../../components/navBar/index.vue";
const pageTitle = ref("");
useDidShow(() => {
const currentPage = Taro.getCurrentPages().slice(-1)[0];
const pageTitle1 = currentPage.config.navigationBarTitleText || "默认标题";
pageTitle.value = pageTitle1;
});
</script>
<style lang="scss">
.wechat-order-detail-container {
}
</style>
主要是这里
const currentPage = Taro.getCurrentPages().slice(-1)[0];
const pageTitle1 = currentPage.config.navigationBarTitleText || "默认标题";
Taro +vue3 的页面结构还有一个