CSS固定在顶部
<view class="header">
<view class="search-topBar">
<view class="search-top"><image src="/static/img/users/fanhuis.png" @click="back"></image></view>
<view class="search-box">
<input style="padding-right: 20rpx;" @input="inputClick" @confirm="inputClick" type="text" placeholder="搜索感兴趣的内容" v-model="keyword" />
</view>
<view class="search-title" @click="inputClick">搜索</view>
</view>
</view>
</view>
css:
.heade {
position: -webkit-sticky;
position: -moz-sticky;
position: -ms-sticky;
position: sticky;
background-color: #fff;
top: 0;
z-index: 20;
}