fix(自学): 手机上「代码排序」「分组」写明先点一下、再点去处,电脑上分组仍提示拖动
Deploy / deploy (push) Canceled after 0s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-10-13 22:27:23 +08:00
1 parent 96a1c3808f
commit 4c47e9389b
2 files changed
+13 -2

No files matched your search

@@ -2,6 +2,7 @@
import ExerciseResult from "./ExerciseResult.vue"
import type { Exercise, ExerciseGroupData } from "utils/types"
import { shuffle } from "../composables/useShuffle"
import { useBreakpoints } from "shared/composables/breakpoints"
const props = defineProps<{ exercise: Exercise; lang?: string }>()
const emit = defineEmits<{
@@ -9,6 +10,7 @@ const emit = defineEmits<{
}>()
const data = computed(() => props.exercise.data as ExerciseGroupData)
const { isDesktop } = useBreakpoints()
const order = ref<number[]>([]) // item 的稳定展示顺序(初始乱序)
const placement = ref<number[]>([]) // placement[itemIdx] = 桶下标,-1 表示在池中
@@ -120,7 +122,11 @@ function reset() {
{{ data.question }}
</p>
<p style="color: var(--learn-muted); font-size: 13px; margin: 0 0 12px">
把下面的项目拖到对应的分组里,也可以先点项目、再点分组。
{{
isDesktop
? "把下面的项目拖到对应的分组里,可在分组间拖动调整。"
: "先点一个项目,再点它该去的分组。"
}}
</p>
<div
@@ -3,6 +3,7 @@ import ExerciseResult from "./ExerciseResult.vue"
import type { Exercise, ExerciseSortData } from "utils/types"
import { shuffle } from "../composables/useShuffle"
import { highlightLines } from "shared/highlight"
import { useBreakpoints } from "shared/composables/breakpoints"
const props = defineProps<{ exercise: Exercise; lang?: string }>()
const emit = defineEmits<{
@@ -10,6 +11,7 @@ const emit = defineEmits<{
}>()
const data = computed(() => props.exercise.data as ExerciseSortData)
const { isDesktop } = useBreakpoints()
type LineItem = { originalIdx: number; text: string }
@@ -90,9 +92,12 @@ const lineHtml = computed<string[]>(() => highlightLines(data.value.lines, props
<template>
<div>
<p style="font-weight: 500; font-size: 16px; margin-bottom: 12px">
<p :style="{ fontWeight: 500, fontSize: '16px', marginBottom: isDesktop ? '12px' : '8px' }">
{{ data.question }}
</p>
<p v-if="!isDesktop" style="color: var(--learn-muted); font-size: 13px; margin: 0 0 12px">
先点一行,再点它该去的位置。
</p>
<n-space vertical :size="6">
<div