nuiDialog 指令把原生的 <dialog> 變成 Needless UI 對話框。強制回應的行為由瀏覽器提供:後方頁面會變得無法互動,焦點會留在對話框內,按 Esc 鍵即可關閉,關閉後焦點會回到開啟它的元素。

[(open)] 繫結到一個 signal,並用 nuiDialogClose="…" 為關閉按鈕指定值,就能知道對話框是如何關閉的。

確認對話框

用於確認破壞性操作。安全選項帶有 autofocus,使用者選擇的值會透過 (closed) 傳出。

Delete “needless-ui”?

This deletes the project and its 3 environments. It can’t be undone.

對話框中的表單

對話框可以容納任何內容。本例中,對話框開啟時第一個欄位會取得焦點。

Edit profile

Your name appears on projects you share.

不可隨意關閉

設定 [dismissible]="false" 後,按 Esc 鍵和點擊背景遮罩都會被忽略,使用者必須選擇其中一個選項。

Updated terms

Escape and backdrop clicks are ignored here. Choose an option to continue.