Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
601 views
in Technique[技术] by (71.8m points)

vue已经获取到通过for循环出来的组件高度,怎么把这些高度值添加到一个新数组?

组件页面通过for循环出不同高度的div,现在通过节点选择器获取到了每个div的高度,但是打印出来是一条一条的,怎么把这写数值放入数组,让我可以通过[0]数值选择值?
image.png
image.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
const heightList = []
heightList.push(res.height)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...