fix: [approvals] Alpine.js v3 호환 결재선 데이터 접근 방식 수정

- __x.$data (v2 문법) → _x_dataStack[0] (v3 문법)으로 변경
- 에디터에 id="approval-line-editor" 추가하여 정확한 요소 선택
- create.blade.php, edit.blade.php 동시 수정
This commit is contained in:
김보곤
2026-02-28 00:45:08 +09:00
parent 28458488d4
commit bcfbcc3a1e
3 changed files with 5 additions and 5 deletions

View File

@@ -83,8 +83,8 @@ class="w-full bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg tran
return;
}
const editor = document.querySelector('[x-data]').__x.$data;
const steps = editor.getStepsData();
const editorEl = document.getElementById('approval-line-editor');
const steps = editorEl._x_dataStack[0].getStepsData();
if (action === 'submit' && steps.filter(s => s.step_type !== 'reference').length === 0) {
showToast('결재자를 1명 이상 추가해주세요.', 'warning');

View File

@@ -119,8 +119,8 @@ class="w-full bg-red-100 hover:bg-red-200 text-red-700 px-4 py-2 rounded-lg tran
return;
}
const editor = document.querySelector('[x-data]').__x.$data;
const steps = editor.getStepsData();
const editorEl = document.getElementById('approval-line-editor');
const steps = editorEl._x_dataStack[0].getStepsData();
if (action === 'submit' && steps.filter(s => s.step_type !== 'reference').length === 0) {
showToast('결재자를 1명 이상 추가해주세요.', 'warning');

View File

@@ -1,5 +1,5 @@
{{-- 결재선 편집 컴포넌트 (Alpine.js) --}}
<div x-data="approvalLineEditor()" class="bg-white rounded-lg shadow-sm p-4">
<div id="approval-line-editor" x-data="approvalLineEditor()" class="bg-white rounded-lg shadow-sm p-4">
<h3 class="text-lg font-semibold text-gray-800 mb-4">결재선</h3>
{{-- 결재선 템플릿 선택 --}}