diff --git a/src/views/account/CategoryView.vue b/src/views/account/CategoryView.vue index 8978f36..5d3203c 100644 --- a/src/views/account/CategoryView.vue +++ b/src/views/account/CategoryView.vue @@ -62,15 +62,21 @@ async function reload() { } // ===== 계층 드래그 정렬 (대분류 블록 / 대분류 내 소분류) ===== +// 스크롤하다 실수로 순서가 바뀌는 것 방지: 기본은 드래그 비활성, '순서변경' 버튼으로 켠다. const majorListEl = ref(null) +const reorderMode = ref(false) let sortables = [] function destroySortables() { sortables.forEach((s) => s.destroy()) sortables = [] } +function toggleReorder() { + reorderMode.value = !reorderMode.value + nextTick(() => initSortable()) // 켜면 생성, 끄면 destroy 후 early-return +} function initSortable() { destroySortables() - if (!majorListEl.value) return + if (!majorListEl.value || !reorderMode.value) return // 대분류 순서 — 블록 단위라 소분류가 함께 이동 sortables.push( Sortable.create(majorListEl.value, { @@ -189,7 +195,12 @@ onBeforeUnmount(destroySortables) - +
≡ 손잡이로 순서 변경 — 대분류는 소분류와 함께, 소분류는 그 대분류 안에서만 이동합니다.
++ ≡ 손잡이를 끌어 순서를 바꾸세요 — 대분류는 소분류와 함께, 소분류는 그 대분류 안에서만 이동. 끝나면 완료. + 순서변경을 누르면 분류 순서를 바꿀 수 있어요. (평소엔 스크롤 중 실수 방지로 잠겨 있어요) +
{{ error }}
불러오는 중...
@@ -211,7 +225,7 @@ onBeforeUnmount(destroySortables)