Skip to content

pantoken / formats/interactions/src / initModal

Hàm: initModal()

initModal(host, dialog, onCommand): void

Kết nối một <dialog class="instui-modal"> CSS hoặc shadow của web component <dialog> với giao thức thuộc tính open và định tuyến lệnh --show/--close/--toggle. Cả hai cách sử dụng truyền cùng một giao diện:

  • CSS: host === dialog (the dialog itself carries the id and open attr)
  • WC: host = custom element, dialog = its shadow &lt;dialog&gt;

Tham số

host

HTMLElement

dialog

HTMLDialogElement

onCommand

OnCommand

Trả về

void