2025-11-13 08:41:08 +08:00

59 lines
914 B
Vue

<template>
<!-- 顶部导航栏 -->
<view class="navbox">
<view class="status_bar"></view>
<uni-nav-bar
:left-icon="showLeft?'left':''"
:title="title"
@clickLeft="goBack"
color="#8B2316"
:border="false"
backgroundColor="#eeeeee"
/>
</view>
</template>
<script setup>
import { ref } from 'vue';
import { onShow } from "@dcloudio/uni-app";
const props=defineProps({
showLeft:{
type:Boolean,
default:true
},
noticeBack:{
type:Boolean,
default:false
},
title:{
type:String,
default:''
}
})
// 方法
const goBack = () => {
uni.navigateBack({
fail() {
uni.redirectTo({
url: '/pages/index/index'
});
}
});
};
</script>
<style scoped>
.navbox{
position: fixed;
top: 0;
left: 0;
right: 0;
height:(var(--status-bar-height)+44px);
z-index: 9999;
}
.status_bar{
height: var(--status-bar-height);
background-color: #eeeeee;
}
</style>