Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
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
|
||||
|
||||
Reference in new issue
Block a user