为了账号安全,请及时绑定邮箱和手机立即绑定

antd组件的methods怎么调用

antd组件的methods怎么调用

千万里不及你 2018-07-07 08:21:28
ant design组件里类似于这种方法是怎么调用的,这不像组件的参数。不知道怎么使用,求教。
查看完整描述

2 回答

?
BIG阳

TA贡献1859条经验 获得超6个赞

https://img1.sycdn.imooc.com//5b48aca20001f5de08000315.jpg

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

查看完整回答
反对 回复 2018-07-13
?
大话西游666

TA贡献1817条经验 获得超14个赞

  constructor(props) {

    super(props);


    this.carouselRef = null;


    this.setCarouselRef = el => {

      this.carouselRef = el;

    };

  }


  componentDidMount() {

    // 调用

    if (this.carouselRef) this.carouselRef.next();

  }


  // render部分

  <Carousel ref={this.setCarouselRef} ></Carousel>


查看完整回答
反对 回复 2018-07-13
  • 2 回答
  • 0 关注
  • 2016 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信