window.addEventListener('scroll',throttle(handleScroll,100));
let throttle_func = null
throttle(func,delay){
var context = this
return function(){
var args = arguments
if(!throttle_func){
throttle_func = setTimeout(function(){
func.apply(context,args)
throttle_func = null
})
}
}
}
handleScroll(){
let offestTop = this.$el.querySelector('#id').getBoundingClientRect().top // 元素距离页面顶部的距离
}