第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

vue 怎么獲取元素?

vue 怎么獲取元素?

慕哥9229398 2018-10-11 14:15:04
//報名數(shù)的滾動        var box = document.querySelector('.list-box'),            boxUl = document.querySelector('.list-box .list-ul'),            boxLi = document.querySelectorAll('.list-ul li'),            startX = 0,            startTime, endTime, moveTime,            startY = 0,            moveDistance = 0;        offLeft = 0;      console.log(boxLi[0].offsetWidth);      alert(boxLi[0])        box.style.width = boxLi[0].offsetWidth * 4 + 'px';                 boxUl.style.width =boxLi[0].offsetWidth * boxLi.length + 'px';               var moveWidth = boxUl.offsetWidth - box.offsetWidth;                這上面是一個代碼片段,頁面是用vue2.0 來做的,boxLi里的li 是 v-for 循環(huán)出來的,boxLi[0]怎么都獲取不到li,  在vue mounted 這里面執(zhí)行也不行,最后我用winod.onload 還是無法獲致到, 求解決方向法,怎么才能在 vue里獲到元素操作???
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 560 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號