首页 > 解决方案 > 在反应中 - 覆盖输入元素的 stepUp 和 stepDown

问题描述

有没有办法在 reactJs 中替换 Input 的 stepUp 和 stepDown 函数?
我可以在 js 中做到这一点:

const inputElement = document.getElementById("inputId");
inputElement.stepUp = function(value){
  console.log('Stepping up ' + value);
};

有什么想法可以在反应中做到这一点吗?

标签: javascriptreactjsdom

解决方案


推荐阅读