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,14 +21,22 @@ export function reset() {
})) }))
} }
export function addFive() { export function add(len = 1) {
files.value.push( if (len == 1) {
...Array.from({ length: 5 }).map(() => ({ files.value.push({
in: "", in: "",
out: "", out: "",
error: false, error: false,
})), })
) } else {
files.value.push(
...Array.from({ length: len }).map(() => ({
in: "",
out: "",
error: false,
})),
)
}
} }
export function remove(index: number) { export function remove(index: number) {

View File

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