zhengkaixin 1 vuosi sitten
vanhempi
commit
f0a522b662
1 muutettua tiedostoa jossa 4 lisäystä ja 7 poistoa
  1. 4 7
      uni_modules/uview-ui/components/u-navbar/u-navbar.vue

+ 4 - 7
uni_modules/uview-ui/components/u-navbar/u-navbar.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="">
 		<view class="u-navbar" :style="[navbarStyle]" :class="{ 'u-navbar-fixed': isFixed, 'u-border-bottom': borderBottom }">
-			<view class="u-status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
+			<view class="u-status-bar" :style="{ height: statusBarHeight* + 'rpx' }"></view>
 			<view class="u-navbar-inner" :style="[navbarInnerStyle]">
 				<view class="u-back-wrap" v-if="isBack" @tap="goBack">
 					<view class="u-icon-wrap">
@@ -31,7 +31,7 @@
 			</view>
 		</view>
 		<!-- 解决fixed定位后导航栏塌陷的问题 -->
-		<view class="u-navbar-placeholder" v-if="isFixed && !immersive" :style="{ width: '100%', height: Number(navbarHeight) + statusBarHeight + 'px' }"></view>
+		<view class="u-navbar-placeholder" v-if="isFixed && !immersive" :style="{ width: '100%', height: (Number(navbarHeight) + statusBarHeight)*2 + 'rpx' }"></view>
 	</view>
 </template>
 
@@ -185,7 +185,7 @@
 			navbarInnerStyle() {
 				let style = {};
 				// 导航栏宽度,如果在小程序下,导航栏宽度为胶囊的左边到屏幕左边的距离
-				style.height = this.navbarHeight + 'px';
+				style.height = this.navbarHeight*2 + 'rpx';
 				// // 如果是各家小程序,导航栏内部的宽度需要减少右边胶囊的宽度
 				// #ifdef MP
 				let rightButtonWidth = systemInfo.windowWidth - menuButtonInfo.left;
@@ -215,7 +215,7 @@
 				style.right = rightButtonWidth - (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + rightButtonWidth +
 					'px';
 				// #endif
-				style.width = uni.upx2px(this.titleWidth) + 'px';
+				//style.width = uni.upx2px(this.titleWidth) + 'px';
 				return style;
 			},
 			// 转换字符数值为真正的数值
@@ -330,14 +330,11 @@
 		@include vue-flex;
 		align-items: center;
 		justify-content: flex-end;
-		
 	}
 
 	.u-slot-content {
-		
 		flex: 1;
 		@include vue-flex;
 		align-items: center;
-		
 	}
 </style>