a.获取dom结构的父容器内添加ref="foodwrapper"
b. :class="{'current':currentIndex == index}"
c. class="food-list good-List-hook"

computed:{
currentIndex(){
for(let i = 0; i < this.listHeight.length; i++){
let height1 = this.listHeight[i];
let height2 = this.listHeight[i + 1];
if( !height2 || (this.scrollY >= height1&&this.scrollY < height2)){
return i;
}
}
return 0;
}
}
8.点击事件高亮
selectMenu(index,event){
if(!event._constructed){
return;
}
let goodsList = this.$refs.foodsWrapper.getElementsByClassName('good-List-hook');
let el = goodsList[index];
this.foodsScroll.scrollToElement(el,300);
},