1、取消原生导航栏
如图:将页面中的原生导航取消
在page.json中需要取消的页面中加入"navigationStyle": "custom"
例如:
{"path": "pages/index/index","style": {"navigationBarTitleText": "首页","navigationStyle": "custom"}
},
2、自定义导航栏
<template><view><view class="top"><u-icon name="arrow-left" color="#fff" size="20" @click="goBack"></u-icon><!-- <view class="">其他内容</view> --></view><view class="" style="height:100vh">内容</view></view>
</template><script setup>const goBack=()=>{uni.navigateBack({delta: 1});}
</script><style lang="scss" scoped>.top{display: flex;align-items: center;width: 100vw;height: 8vh;padding: 1vh 3vw 0 3vw;position: fixed;background-color: #023D8D;}
</style>