fix:字段无法删除

This commit is contained in:
JaguarJack
2024-04-22 17:24:51 +08:00
parent d995a8ce0d
commit dede7b0ba0
4 changed files with 103 additions and 4 deletions

Submodule modules/Cms deleted from 36e9e66e38

View File

@@ -0,0 +1,11 @@
<script setup lang="ts">
</script>
<template>
$END$
</template>
<style scoped lang="scss">
</style>

View File

@@ -90,7 +90,7 @@
</div>
</template>
<script lang="ts" setup>
import { computed, Ref, ref } from 'vue'
import { Ref, ref } from 'vue'
import { useSchemaStore, Structure } from '../store'
import { Delete, Plus, Edit } from '@element-plus/icons-vue'
import type { FormInstance } from 'element-plus'
@@ -119,6 +119,8 @@ const updateField = (id: number) => {
structure.value = s
}
})
schemaStore.setStructures(structures.value)
}
const form = ref<FormInstance>()
@@ -136,7 +138,10 @@ const submitStructure = (formEl: FormInstance | undefined) => {
}
const deleteField = (id: number) => {
schemaStore.filterStructures(id)
structures.value = structures.value.filter((s: Structure) => {
return !(s.id === id)
})
schemaStore.setStructures(structures.value)
}
const next = () => {
@@ -153,7 +158,6 @@ const next = () => {
}
// 调整数据结构
const onEnd = () => {
console.log(structures.value)
schemaStore.setStructures(structures.value)
}
const types: string[] = [