模拟修改react管理的input值
const inputElement = document.getElementById('declarePrice-0');
// 创建一个新的事件对象并赋值新的值
const nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value').set;
nativeInputValueSetter.call(inputElement, '100.00'); // 设定新的值
// 创建并触发 'input' 事件
const inputEvent = new Event('input', { bubbles: true });
inputElement.dispatchEvent(inputEvent); // 触发 React 的 onChange