trigger1 Event vs CustomEvent && How to trigger event with data Event vs CustomEvent CustomEvent can send data through 'detail' property, but Event can not do that; Event const eventInstance = new Event(':eventName'); // add event on document document.addEventListener(':eventName', (e) => { // TODO console.log(e); }); // trigger event document.dispatch(eventInstance);CustomEvent const customEventInstance = new CustomEvent(':custom.. 2022. 6. 27. 이전 1 다음