TIL-20220626

__flow__·2022년 6월 25일
0

TIL

목록 보기
1/49
post-thumbnail

Lit

  • (documentation) Components -> Events

Web

  • (MDN) Creating and triggering events
const event = new CustomEvent('build', { detail: elem.datset.time });

To add more data to the event object, the customEvent interface exists and the detail property can be used to pass custom data.

  • (MDN) Event()
// create a look event that bubbles up and cannot be canceled
const evt = new Event('look',{ 
  bubbles: true, 
  cancelable: false });

document.dispatchEvent(evt);

// event can be dispatched from any element,
// not only the document
myDiv.dispatchEvent(evt);
profile
fullcycle(fullstack), python/javascript, keepflowin, he/him

0개의 댓글