Files
danyang-match/h5-demo/src/layouts/PageLayout.vue
T
WorkBuddy 69ebf33e18
CI/CD Pipeline / Backend Build & Test (push) Canceled after 0s
CI/CD Pipeline / Admin Web Build (push) Canceled after 0s
CI/CD Pipeline / Mini Program Compile Check (push) Canceled after 0s
CI/CD Pipeline / Migration Validation (push) Canceled after 0s
CI/CD Pipeline / Test Shell Guard (Phase 23 Gate) (push) Canceled after 0s
CI/CD Pipeline / UI Contracts (source-structure gates) (push) Canceled after 0s
CI/CD Pipeline / E2E (live stack) (push) Canceled after 0s
release: freeze demo v1.1.0 2026-10-19
2026-10-19 20:36:22 +08:00

41 lines
768 B
Vue

<template>
<div class="page-layout">
<van-nav-bar
:title="title"
left-arrow
fixed
placeholder
@click-left="onBack"
>
<template v-if="$slots.right" #right>
<slot name="right" />
</template>
</van-nav-bar>
<div class="page-layout__body">
<slot />
</div>
</div>
</template>
<script setup lang="ts">
import { useRouter } from 'vue-router'
withDefaults(defineProps<{ title?: string }>(), { title: '' })
const router = useRouter()
function onBack() {
if (window.history.length > 1) router.back()
else router.replace('/home')
}
</script>
<style scoped>
.page-layout {
min-height: 100vh;
background: var(--mini-bg);
}
.page-layout__body {
min-height: calc(100vh - 46px);
}
</style>