ReactJS:ES6从另一个类方法函数调用类方法?

时间:2017-03-31 22:41:32

标签: reactjs ecmascript-6

基本上从不同类方法中的函数调用类方法。

export default class Test extends Component {...
  constructor(props) {
    super(props)
    this.state = {};
  }

  meth1() {
    //do_stuff...
  }

  meth2() {
   var test = function() {
     this.meth1() // doesn't work
   }
   _.debounce(test, 200);
 }
}

我知道这可能与绑定等有关。我虽然有点迷失。这只是填充空间并满足问题验证要求的更多文本。

0 个答案:

没有答案
相关问题