fix: 数据源删除最后一个参数

This commit is contained in:
dataeaseShu 2023-12-28 17:39:31 +08:00
parent 75fed43c4b
commit ad9c38cbaf

View File

@ -45,15 +45,15 @@ onBeforeMount(() => {
})
const remove = (index: number) => {
if (isDisable(index)) return
if (isDisable()) return
//
items.value.splice(index, 1)
}
const change = () => {
items.value.push(new KeyValue({ enable: true }))
}
const isDisable = (index: number) => {
return items.value.length - 1 === index
const isDisable = () => {
return items.value.length === 1
}
const querySearch = (queryString, cb) => {
const results = queryString
@ -128,7 +128,7 @@ const createFilter = (queryString: string) => {
</el-col>
<el-col :span="1">
<el-button text :disabled="isDisable(index)" @click="remove(index)">
<el-button text :disabled="isDisable()" @click="remove(index)">
<template #icon>
<Icon name="icon_delete-trash_outlined"></Icon>
</template>