vue 选择框(vue 滚动条位置)

本文主要介绍vue选择框(vue滚动条位置),下面一起看看vue选择框(vue滚动条位置)相关资讯。
话不多说,直接代码供以后重用:
脚本类型= 文本/ecmascript-6 从导入b scroll ;更好的卷轴 ;const : { s: { typ:对象} },data{ r:[],listh:[],scrolly: 0 };}、comput: { current index{ for(设i = 0;i this . list height . length;i){ let height 1 = this . list height[i];设height 2 = this . list height[i 1];如果(!height 2 | |(this . scrolly = height 1 this . scrolly height 2)){ return i;};}返回0;} },已创建{ this . class map =[ ;减少 , 折扣 , 特殊和。;, 发票和发票。;, 担保与保险。;];这个。$ http . get( ;/api/ods ;).然后((response)= { response = response . body;if(response . errno = = = err _ ok){ this . ods = response . data;这个。$nexttick( = { this。_ init scroll;这个。_ calculat: { _ init scroll{ this . menus scroll = new b scroll(this。$refs.menuwrapper,{ click: true });this . food scroll = new b scroll(this。$r: 3 });this . food scroll . on( ;卷轴 ,(pos)= { this . scrolly = math . abs(math . round(pos . y));});},_ calculate height{ let food list = this。$ refs . foods wrapper . getelementsbyclassname( ;食物清单钩和。;);设高度= 0;this.listheight.push(高度);for(设i = 0;i foodlist.lengthi){ let item = food list[i];height = item.clientheightthis.listheight.push(高度);} },selectmenu(index,event) { if(!事件。_ constructed){ return;};console.log(索引);让foodlist = this。$ refs . foods wrapper . getelementsbyclassname( ;食物清单钩和。;);let el = food list[index];this . food scroll . scroll to element(el,300);} }};/script以上是边肖介绍的vue2.0中ods购物条滚动算法的实现代码。希望对你有帮助。如果您有任何问题,请给我留言,边肖将及时回复您。非常感谢您对网站的支持!
标签:
代码网站介绍希望
了解更多vue选择框(vue滚动条位置)相关内容请关注本站点。

4s主板怎么拆,4S主板坏了求支招该怎么维修啊
索尼手机安全模式怎么解除,索尼电视显示安全模式怎么解除
ios怎么打度的符号,度符号 °怎么打手机
惠普笔记本固态硬盘多少钱一张,惠普笔记本硬盘换一个120G要多少钱
win10音频打不开(windows音频无法启动)
vue 选择框(vue 滚动条位置)
2023年会出什么手机(20213月值得购买的手机)
北京新浪科技支付有限公司(北京新浪科技有限公司客服电话)
五千价位性价比最高的笔记本,游戏本4000到5000推荐
麒麟系统字体在哪个文件夹(麒麟系统怎么装输入法)
windows10此电脑在哪里(win10电脑此电脑在哪儿打开)
误充了超级会员怎么退钱(误充了超级会员怎么退回)
支付宝怎么能免费转账(支付宝怎么免费转款)
win10家庭版升级win10专业版后能改回去吗(win10家庭版升级专业版失败了怎么回退回)
电脑总是提示文件损坏怎么办(电脑文件经常无缘无故损坏)
小米换手机怎么转移所有东西(小米手机换新手机怎样一键搬家到新手机)
蓝博兴手机怎么硬格
win10电脑字体模糊怎么解决(win10系统电脑字体模糊怎么办)
bandizip解压密码是多少(bandizip压缩软件下载)
抖音怎么自制音乐用来拍抖音(抖音怎么自制音乐视频)