<view class="performance-type-lists" :class="className">
<view>
<view>简介</view>
<view></view>
</view>
<view>
<view>须知</view>
<view></view>
</view>
<view>
<view>推荐</view>
<view></view>
</view>
</view>
<script>
export default {
data(){
className: '',
},
methods:{
onPageScroll(e){
if(e.scrollTop>277){//277是需要固定的地方到顶部的距离
this.className = 'sfixed';
}else{
this.className = '';
}
},
}
}
</script>
<style>
.sfixed{
position: fixed;
top: 130upx;
left: 0upx;
z-index: 9999;
}
</style>
uni-app小程序滑动到顶部固定
最新推荐文章于 2024-07-03 17:07:00 发布