feat: 添加navbar导航栏

修复屏幕宽度过宽导致的苹果手机无法返回的问题
This commit is contained in:
2025-08-25 14:36:41 +08:00
parent 946f4a2e6b
commit 5adbe3f18d
2 changed files with 18 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
<template>
<view class="top">
<view class="top" :class="[sticky ? 'sticky': '']">
<view v-show="showBack" class="top-back" @click="toBack()">
<u-icon color="#333" size="20" name="arrow-left"></u-icon>
</view>
@@ -24,11 +24,16 @@
goPgae:{
type:String,
default:''
}
},
// 启用粘性滚动
sticky: {
type: Boolean,
default: false
}
},
data() {
return {
}
},
methods: {
@@ -45,7 +50,7 @@
uni.switchTab({
url:this.backUrl
})
}else{
}else{
uni.navigateTo({
url:this.backUrl
});
@@ -61,7 +66,7 @@
}else{
uni.navigateBack();
}
}
}
}
@@ -94,6 +99,13 @@
text-overflow: ellipsis;
line-height: 40px;
}
&.sticky {
position: sticky;
top: 0;
//防止其他元素遮盖
z-index: 99;
}
}
// .arrow:before {
// content: " ";