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