fix: task remove env error

This commit is contained in:
engigu
2026-01-15 19:18:50 +08:00
parent 4cd29ba92c
commit f87cc1c0f2
2 changed files with 5 additions and 7 deletions
+5 -6
View File
@@ -132,8 +132,7 @@ function addEnv(id: number) {
}
function removeEnv(id: number) {
const idx = selectedEnvIds.value.indexOf(id)
if (idx !== -1) selectedEnvIds.value.splice(idx, 1)
selectedEnvIds.value = selectedEnvIds.value.filter(envId => envId !== id)
}
async function save() {
@@ -266,10 +265,10 @@ async function save() {
</PopoverContent>
</Popover>
<div v-if="selectedEnvs.length > 0" class="flex flex-wrap gap-1">
<Badge v-for="env in selectedEnvs" :key="env.id" variant="secondary" class="gap-0.5 pr-0.5 text-xs h-5">
{{ env.name }}
<X class="h-2.5 w-2.5 cursor-pointer hover:text-destructive" @click.stop="removeEnv(env.id)" />
</Badge>
<div v-for="env in selectedEnvs" :key="env.id" class="inline-flex items-center gap-0.5 px-2 py-0.5 text-xs h-5 rounded-full bg-secondary text-secondary-foreground">
<span>{{ env.name }}</span>
<X class="h-2.5 w-2.5 cursor-pointer hover:text-destructive" @click="removeEnv(env.id)" />
</div>
</div>
</div>
</div>