mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-09 10:56:47 +08:00
feat: 添加navbar导航栏
修复屏幕宽度过宽导致的苹果手机无法返回的问题
This commit is contained in:
@@ -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: " ";
|
||||
|
||||
Reference in New Issue
Block a user