全局

 document.onkeydown = function (e) {
   let key = (window as any).event.keyCode;
  if (key === 13) {
     console.log('回车')
  }
 }

render 绑定

  onPressEnter: async (e) => {
        if (e.keyCode === 13) {
       	//回车
        }
      }
Logo

前往低代码交流专区

更多推荐