xzhce

import BScroll from "better-scroll";

 

selectkey(index){

获取右侧所有元素的 classname
const citylist = this.$refs.area_scroll.getElementsByClassName(
"citylist"
);
// 根据下标,滚动到相对应的元素上
let el = citylist[index];
// 滚动到对应的位置上
this.scroll.scrollToElement(el, 250);

}

分类:

技术点:

相关文章:

  • 2021-12-15
  • 2021-12-01
  • 2021-04-08
  • 2021-12-09
  • 2022-12-23
  • 2022-01-18
  • 2022-02-19
猜你喜欢
  • 2022-02-03
  • 2022-02-05
  • 2021-11-19
  • 2022-02-16
  • 2022-01-13
  • 2022-01-09
  • 2021-09-07
相关资源
相似解决方案