Skip to content

pantoken / formats/interactions/src / initModal

函式: initModal()

initModal(host, dialog, onCommand): void

將 CSS <dialog class="instui-modal"> 或 web 元件的 shadow <dialog> 接到 open 屬性協定與 --show/--close/--toggle 指令路由。兩種用法傳遞相同的介面:

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

參數

host

HTMLElement

dialog

HTMLDialogElement

onCommand

OnCommand

回傳

void