update
This commit is contained in:
@@ -21,14 +21,22 @@ 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) {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user