import { Controller } from '@hotwired/stimulus'; /** * Dialog 모달을 제어하는 Stimulus 컨트롤러 * 특히, open 속성이 있을 때 모달의 백드롭 이 올바르게 표시되도록 처리합니다. */ export default class extends Controller { connect() { if (this.element.hasAttribute('open')) { this.element.close(); this.element.showModal(); } } close({ params }) { if (this.element.open) { this.element.close(); // 모달이 닫혔음을 알리는 커스텀 이벤트 디스패치 // 닫힐 때 추가 정보를 전달할 수 있습니다. this.dispatch('closed', { detail: params }); } } }

AltStyle によって変換されたページ (->オリジナル) /