angular学习 @ViewChild

时间:2020-01-24 22:33:50   收藏:0   阅读:160
@ViewChild(‘sliderIMG‘, { static: true }) sliderIMG: ElementRef
// 第二个值不知道是怎么用的

const imgList = this.sliderIMG.nativeElement.getElementsByTagName(‘li‘)
// 就和普通的操作dom一样,不知道这样用对不对

 

原文:https://www.cnblogs.com/foreversimon/p/12232609.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!