新建test.vue
<template>
<view class="main">
<view class="box" :class="showTop?'show':''">
<video class="video"
poster="https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=2734610050,3720942580&fm=26&gp=0.jpg"
src="https://www.runoob.com/try/demo_source/movie.mp4" controls></video>
</view>
<view class="centen" v-for="i in 55">
内容{{i}}
</view>
</view>
</template>
<script>
export default {
data() {
return {
showTop:false
}
},
methods: {
onPageScroll(e){
console.log(e.scrollTop)
var that = this
if(e.scrollTop>100){
that.showTop = true
}else{
that.showTop = false
}
},
}
}
</script>
<style>
.main{
width: 100%;
height: 12000rpx;
}
.box{
width: 100%;
height: 430rpx;
}
.video{
width: 100%;
height: 100%;
}
.centen{
width: 100%;
height: auto;
}
.show{
position: fixed;
top: 0;
}
</style>
1***@qq.com
帮忙处理下我发的帖子啊,大佬
2020-08-03 18:30