dl_uniapp/components/navigation/navigationBar.vue
2025-04-03 16:46:51 +08:00

76 lines
1.3 KiB
Vue

<template>
<!-- header -->
<view :style="{ backgroundColor:backgroundColor }" class="navigationBar">
<template>
<view class="navigationBarBack" @click="back">
<uni-icons size="24" type="left" :color="titleColor"></uni-icons>
</view>
<view class="navigationBarTitle" :style="{ color: titleColor }">
{{ title }}
</view>
<view class="navigationBarIcon" :style="{ color: titleColor }">
</view>
</template>
</view>
</template>
<script>
/* 计算标题位置 */
import {
getWXStatusHeight
} from "@/utils/common.js";
export default {
props: {
backgroundColor: {
type: String,
default: '#317DFA'
},
title: String,
titleColor: {
type: String,
default: '#fff'
},
},
data() {
return {
}
},
methods: {
back() {
uni.navigateBack()
},
clearNoReadFun() {
this.$emit('clearNoRead')
}
}
}
</script>
<style lang="scss" scoped>
.navigationBar {
position: absolute;
top: var(--status-bar-height);
height: 90rpx;
width: 100%;
display: flex;
align-items: center;
font-size: 30rpx;
justify-content: center;
z-index: 999;
.navigationBarBack {
width: 200rpx;
}
.navigationBarTitle {
flex: 1;
text-align: center;
}
.navigationBarIcon {
width: 200rpx;
}
}
</style>