refactor: 评测创建步骤导航条结构优化

步骤连接符独立为单独元素并随完成状态高亮,修复窄屏连接线显示。
This commit is contained in:
caoxiaozhu
2026-07-13 17:12:49 +08:00
parent 8c1a0d785c
commit 42f2efb449

View File

@@ -194,9 +194,13 @@ onMounted(loadData)
<main v-loading="loading" class="wizard-main">
<div class="wizard-steps-container" aria-label="评测任务创建步骤">
<div class="custom-wizard-steps">
<template v-for="(step, index) in WIZARD_STEPS" :key="step.title">
<div
v-if="index !== 0"
class="step-connector"
:class="{ 'is-active': currentStep >= index }"
></div>
<div
v-for="(step, index) in WIZARD_STEPS"
:key="step.title"
class="step-item"
:class="{
'is-active': currentStep === index,
@@ -204,7 +208,6 @@ onMounted(loadData)
}"
:aria-current="currentStep === index ? 'step' : undefined"
>
<div v-if="index !== 0" class="step-connector"></div>
<div class="step-node">
<div class="step-icon" aria-hidden="true">
<i v-if="currentStep > index" class="fa fa-check" />
@@ -216,6 +219,7 @@ onMounted(loadData)
</div>
</div>
</div>
</template>
</div>
</div>
@@ -308,14 +312,10 @@ onMounted(loadData)
.step-item {
display: flex;
flex: 1;
flex: none;
align-items: center;
}
.step-item:first-child {
flex: 0;
}
.step-connector {
flex: 1;
height: 2px;
@@ -324,8 +324,7 @@ onMounted(loadData)
transition: background-color 0.2s ease;
}
.step-item.is-active .step-connector,
.step-item.is-completed .step-connector {
.step-connector.is-active {
background: #5146e5;
}