本文主要介紹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壓縮軟件下載)
抖音怎么自制音樂用來拍抖音(抖音怎么自制音樂視頻)