背景属性
background-attachment: fied
可以让背景图片固定:
(小技巧:让元素占满整个屏,如下)
<template>
<div class="ranking">
<div>
<div v-for="i in 50">{{i+'200000'}}</div>
</div>
</div>
</template>
<script>
export default {}
</script>
<style lang="stylus" scoped>
.ranking
width 100%
height 100%
position relative
top 0
left 0
right 0
bottom 0
background-image url("../../assets/hdgz_bg.png")
background-repeat repeat
background-attachment fixed
</style>