之前我撸了个油猴的时候有找过,vue,react 事件都绑定到 dom 上了,需要自已触发一个事件
```js
const mouseClickEvents = ['mousedown', 'click', 'mouseup'];
function simulateMouseClick(element){
mouseClickEvents.forEach(mouseEventType =>
element.dispatchEvent(
new MouseEvent(mouseEventType, {
view: window,
bubbles: true,
cancelable: true,
buttons: 1
})
)
);
}
var element = document.querySelector('div[class="UFIInputContainer"]');
simulateMouseClick(element);
```
来自
https://stackoverflow.com/questions/40091000/simulate-click-event-on-react-element