update:新增稳定训练
This commit is contained in:
@@ -13,7 +13,20 @@ const props = defineProps({
|
||||
});
|
||||
|
||||
const previewLines = computed(() => {
|
||||
return props.lines.map((line) => String(line || "").trim()).filter(Boolean);
|
||||
return props.lines
|
||||
.map((line) => {
|
||||
const rawParts = Array.isArray(line?.parts)
|
||||
? line.parts
|
||||
: [{ text: line }];
|
||||
const parts = rawParts
|
||||
.map((part) => ({
|
||||
text: String(part?.text ?? part ?? "").trim(),
|
||||
}))
|
||||
.filter((part) => part.text);
|
||||
|
||||
return { parts };
|
||||
})
|
||||
.filter((line) => line.parts.length > 0);
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -27,13 +40,16 @@ const previewLines = computed(() => {
|
||||
<view class="difficulty-preview__content">
|
||||
<text class="difficulty-preview__title">{{ title }}</text>
|
||||
<view class="difficulty-preview__copy">
|
||||
<text
|
||||
<view
|
||||
v-for="(line, index) in previewLines"
|
||||
:key="`${line}-${index}`"
|
||||
:key="index"
|
||||
class="difficulty-preview__line"
|
||||
>
|
||||
{{ line }}
|
||||
</text>
|
||||
<text
|
||||
v-for="(part, partIndex) in line.parts"
|
||||
:key="partIndex"
|
||||
>{{ part.text }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -86,6 +102,4 @@ const previewLines = computed(() => {
|
||||
.difficulty-preview__line {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user