jjzjj

handleKeyPress

全部标签

javascript - 如何在 ReactJS onKeyPress 事件中检测 'Shift + Enter'?

如何检测ReactJSonKeyPress事件中的“Shift+Enter”?这可能吗?https://jsfiddle.net/jacobgoh101/cyLqfcts/3/classAppextendsReact.Component{constructor(props){super(props);this.handleKeyPress=this.handleKeyPress.bind(this);}handleKeyPress(e){console.log(e.key);$('#app').append(""+e.key);}render(){return();}}ReactDOM