This commit is contained in:
2025-05-13 12:01:14 +08:00
parent c09323cc8f
commit 5240e029c5
2 changed files with 16 additions and 7 deletions

View File

@@ -21,15 +21,23 @@ export function reset() {
}))
}
export function addFive() {
export function add(len = 1) {
if (len == 1) {
files.value.push({
in: "",
out: "",
error: false,
})
} else {
files.value.push(
...Array.from({ length: 5 }).map(() => ({
...Array.from({ length: len }).map(() => ({
in: "",
out: "",
error: false,
})),
)
}
}
export function remove(index: number) {
files.value = files.value.filter((_, i) => i !== index)

View File

@@ -1,6 +1,6 @@
<script lang="ts" setup>
import {
addFive,
add,
download,
files,
onChange,
@@ -13,7 +13,8 @@ import {
<n-flex vertical>
<n-flex>
<n-button @click="reset">清空</n-button>
<n-button @click="addFive">增加5</n-button>
<n-button @click="add(1)">增加1</n-button>
<n-button @click="add(5)">增加5个</n-button>
<n-button @click="run">先运行</n-button>
<n-button @click="download">再下载</n-button>
</n-flex>