Skip to content

pantoken-root / formats/interactions/src / initModal

تابع: initModal() ​

initModal(host, dialog, onCommand): void

یک CSS <dialog class="instui-modal"> یا 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