fix: task remove env error
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
# 白虎面板
|
# 白虎面板
|
||||||
|
|
||||||
[](https://hits.sh/github.com/engigu/baihu-panel/)
|
[](https://hits.sh/github.com/engigu/baihu-panel/)
|
||||||
[](https://ghcr-badge.egpl.dev/engigu/baihu/tags)
|
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
|
|||||||
@@ -132,8 +132,7 @@ function addEnv(id: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function removeEnv(id: number) {
|
function removeEnv(id: number) {
|
||||||
const idx = selectedEnvIds.value.indexOf(id)
|
selectedEnvIds.value = selectedEnvIds.value.filter(envId => envId !== id)
|
||||||
if (idx !== -1) selectedEnvIds.value.splice(idx, 1)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function save() {
|
async function save() {
|
||||||
@@ -266,10 +265,10 @@ async function save() {
|
|||||||
</PopoverContent>
|
</PopoverContent>
|
||||||
</Popover>
|
</Popover>
|
||||||
<div v-if="selectedEnvs.length > 0" class="flex flex-wrap gap-1">
|
<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">
|
<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">
|
||||||
{{ env.name }}
|
<span>{{ env.name }}</span>
|
||||||
<X class="h-2.5 w-2.5 cursor-pointer hover:text-destructive" @click.stop="removeEnv(env.id)" />
|
<X class="h-2.5 w-2.5 cursor-pointer hover:text-destructive" @click="removeEnv(env.id)" />
|
||||||
</Badge>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user