在使用键盘监听键盘事件时直接绑定没有任何反应。  

vue 监听键盘事件

直接在生命周期中进行绑定就可以了。

created:function(){
let _this = this;
document.onkeydown = function(e){
let _key = window.event.keyCode;
if(_key === 13){
_this.login(1);
}
}
},

相关文章:

  • 2021-10-25
  • 2021-10-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2021-08-29
相关资源
相似解决方案