update
This commit is contained in:
@@ -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(
|
files.value.push(
|
||||||
...Array.from({ length: 5 }).map(() => ({
|
...Array.from({ length: len }).map(() => ({
|
||||||
in: "",
|
in: "",
|
||||||
out: "",
|
out: "",
|
||||||
error: false,
|
error: false,
|
||||||
})),
|
})),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function remove(index: number) {
|
export function remove(index: number) {
|
||||||
files.value = files.value.filter((_, i) => i !== index)
|
files.value = files.value.filter((_, i) => i !== index)
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user