+24
-2
@@ -151,7 +151,8 @@
|
||||
<div class="grid grid-cols-3 sm:grid-cols-6 gap-2">
|
||||
<button
|
||||
type="button"
|
||||
v-for="sub in subjectOptions"
|
||||
v-for="sub in subjectOptions"
|
||||
:data-subject="sub"
|
||||
:key="sub"
|
||||
@click="formData.subject = sub"
|
||||
:class="[
|
||||
@@ -486,7 +487,28 @@ const currentRollingMsg = ref(rollingMessages[0])
|
||||
let rollingTimer = null
|
||||
|
||||
onMounted(() => {
|
||||
let idx = 0
|
||||
// 외부 모달에서 과목 선택 시 반응형 폼 자동 동기화
|
||||
if (typeof window !== 'undefined') {
|
||||
window.addEventListener('select-subject', (e) => {
|
||||
if (e.detail && e.detail.subject) {
|
||||
const target = e.detail.subject;
|
||||
try {
|
||||
if (typeof subjects !== 'undefined' && Array.isArray(subjects)) {
|
||||
const found = subjects.find(s => s.name === target || s.label.startsWith(target));
|
||||
if (found) formData.subject = found.name;
|
||||
} else if (typeof subjectOptions !== 'undefined' && Array.isArray(subjectOptions)) {
|
||||
const found = subjectOptions.find(s => s === target || s.startsWith(target));
|
||||
if (found) formData.subject = found;
|
||||
} else {
|
||||
formData.subject = target;
|
||||
}
|
||||
} catch (_) {
|
||||
formData.subject = target;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
let idx = 0
|
||||
rollingTimer = setInterval(() => {
|
||||
idx = (idx + 1) % rollingMessages.length
|
||||
currentRollingMsg.value = rollingMessages[idx]
|
||||
|
||||
Reference in New Issue
Block a user