antd组件的methods怎么调用

https://img4.mukewang.com/5b48ac7d0001353c08000250.jpg

ant design组件里类似于这种方法是怎么调用的,这不像组件的参数。不知道怎么使用,求教。

千万里不及你
浏览 2022回答 2
2回答

BIG阳

如果我按钮事件是在另一个组件这个怎么传输,给组件绑定ref打印出来的是这样的

大话西游666

&nbsp; constructor(props) {&nbsp; &nbsp; super(props);&nbsp; &nbsp; this.carouselRef = null;&nbsp; &nbsp; this.setCarouselRef = el => {&nbsp; &nbsp; &nbsp; this.carouselRef = el;&nbsp; &nbsp; };&nbsp; }&nbsp; componentDidMount() {&nbsp; &nbsp; // 调用&nbsp; &nbsp; if (this.carouselRef) this.carouselRef.next();&nbsp; }&nbsp; // render部分&nbsp; <Carousel ref={this.setCarouselRef} ></Carousel>
打开App,查看更多内容
随时随地看视频慕课网APP