app.directive('ngEnter', function() {
  return function(scope, element, attrs) {
    element.bind("keydown keypress", function(event) {
      if(event.which === 13) {
        scope.$apply(function(){
          scope.$eval(attrs.ngEnter);
        });
        event.preventDefault();
      }
    });
  };
});

pc端也就是enter键。

在移动应用app上,就是输入法上的go

相关文章:

  • 2022-12-23
  • 2021-08-15
  • 2021-12-01
  • 2021-07-02
  • 2022-01-22
  • 2021-10-09
  • 2021-06-29
  • 2021-08-01
猜你喜欢
  • 2021-07-19
  • 2022-02-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
相关资源
相似解决方案