u-navber自定义导航栏封装

效果图:
在这里插入图片描述

<template>
	<view>
		<u-navbar :is-back="false" :height="'208rpx'">
		<view class="navbar">
			<view class="title">
				<view class="back">
				</view>
				{{title}}
			</view>
			<view class="content">
				<view class="search">
					<image src="../../static/images/search.png" class="searchImage"></image>
					<u-input placeholder="请输入您想要的宝贝"></u-input>
					<u-button style="width: 46rpx;height: 40rpx;margin-right: 20rpx;">搜索</u-button>
				</view>
				
			</view>
		</view> </u-navbar>
		<view class="placeholder">
		</view>
			</view>
</template>

<script>
	export default {
		props:{
			title:{
				type:String,
				default:'首页'
			},
		},
		data() {
			return {
			}
		},
		methods: {
			
		}
	}
</script>

<style scoped>
	.navbar{
		display: flex;
		align-items: center;
		flex-wrap: wrap;
		width: 100%;
		height: 208rpx;
	}
 .back{
	 background: url(../../static/images/tabbarBack.png);
	 background-size:100% 100%;
	 background-repeat: no-repeat;
	 width: 60rpx;
	 height: 60rpx;
	 position: absolute;
	 left: 20rpx;
	 top: 16rpx;
 }
 .title{
	 position: relative;
	 width: 100%;
	 height: 88rpx;
	 font-size: 36rpx;
	 font-weight: bold;
	 color: #333333;
	 text-align: center;
	 line-height: 88rpx;
 }
 .content{
	 width: 100%;
	 height: 120rpx;
	 padding: 20rpx;
	 display: flex;
	 align-items: center;
 }
 .search{
	 width: 100%;
	 height: 100%;
	 background-color: #F3F4F5;
	 display: flex;
	 align-items: center;
 }
 .searchImage{
	 width: 60rpx;height:60rpx;
	 margin-left:24rpx;
 }
 /deep/ .u-input{
	 display: inline-flex !important;
 }
 /deep/ uni-button{
	 background-color: #F3F4F5;
 }
  /deep/ .u-hairline-border:after{
		border:none
	}
	/deep/ .u-size-default{
		font-size: 28rpx;
	}
	/deep/ .u-btn--default{
		  border-color: #c0c4cc; 
			background-color: #F3F4F5;
			color:#333333
	}
	.placeholder{
		width: 100%;
		height: 208rpx;
		z-index: -1;
	}
</style>

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值