Javascript 在React JS中,此关键字之前的::是什么?
我在一些react js库中看到如下语法。这是什么意思?如何帮助我的代码Javascript 在React JS中,此关键字之前的::是什么?,javascript,reactjs,Javascript,Reactjs,我在一些react js库中看到如下语法。这是什么意思?如何帮助我的代码 const inputAttributes = { id: 'events-playground', placeholder: 'Where are you now?', onChange: ::this.onInputChanged, onBlur: ::this.onInputBlurred }; 谢谢。这是新的ES7语法 ES5中的等效值 const inputAttributes = { id
const inputAttributes = {
id: 'events-playground',
placeholder: 'Where are you now?',
onChange: ::this.onInputChanged,
onBlur: ::this.onInputBlurred
};
谢谢。这是新的ES7语法
ES5中的等效值
const inputAttributes = {
id: 'events-playground',
placeholder: 'Where are you now?',
onChange: this.onInputChanged.bind(this),
onBlur: this.onInputBlurred.bind(this)
};
谢谢我可以在我的react代码中使用它吗,或者使用中存在限制?您可以链接到相关文档吗