CustomNav.nvue
1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<template>
<view class="header" :style="`background-color:${bgColor}`">
<StatusBar />
<uv-navbar
class="custom-nav-bar"
:title="title"
:bg-color="bgColor"
:titleStyle="{fontSize:'32rpx',fontWeight:'bold',color: titleColor}"
>
<template v-slot:left>
<slot name="left"></slot>
<template v-if="!$slots.left">
<view v-if="isTab"></view>
<uv-icon v-else name="arrow-left" :color="arrowLeftColor" size="20px" @tap="backTo" />
</template>
</template>
<template v-slot:right>
<slot name="right"></slot>
</template>
</uv-navbar>
<view v-if="commonNav" style="height: 44px;"></view>
</view>
</template>
<script setup>
import StatusBar from '@/components/StatusBar.vue';
defineProps({
title: {
type: String,
required: true
},
bgColor:{
type: String,
// default: '#3277FB'
default: '#3277FB'
},
isTab:{
type: Boolean,
default: false
},
titleColor:{
type: String,
default: '#ffffff'
},
arrowLeftColor:{
type: String,
default: '#ffffff'
},
commonNav:{
type: Boolean,
default: true
}
})
const backTo = ()=>{
uni.navigateBack({
delta: 1
})
}
</script>
<style lang="scss" scoped>
</style>