uniapp 顶部tabs固定

增加sticky-top样式 

		<view class="sticky-top">
			<u-tabs @change="changePackStatus" height="84" font-size="28" name="cate_name" bar-width="60" bar-height="4"
			 active-color="#EB9309" count="cate_count" :list="list" :is-scroll="false" :current="current"></u-tabs>
			 <view class="search-box">
			 	<u-search search-icon="/static/images/search.png" :show-action="false" bg-color="#F5F5F5" placeholder="搜索订单号或备注"
			 	 @change="search" v-model="keyword"></u-search>
			 </view>
		</view>
	.sticky-top{
		position: sticky;
		top: 0;
		left: 0;
		right: 0;
		width: 100%;
		z-index: 1;
	}

 

上一篇:CSS布局:sticky定位


下一篇:position 定位