fix: added name for section & column

This commit is contained in:
Shariq Ansari 2025-01-02 02:14:55 +05:30
parent e6470562a7
commit beedb11cd1
2 changed files with 11 additions and 4 deletions

View File

@ -42,7 +42,7 @@ import {
Badge,
ErrorMessage,
} from 'frappe-ui'
import { evaluateDependsOnValue, createToast } from '@/utils'
import { evaluateDependsOnValue, createToast, getRandom } from '@/utils'
import { ref, computed } from 'vue'
const props = defineProps({
@ -121,13 +121,18 @@ const tabs = computed(() => {
_tabs.push({
label: field.label,
name: field.value,
sections: [{ columns: [{ fields: [] }] }],
sections: [
{
name: 'section_' + getRandom(),
columns: [{ name: 'column_' + getRandom(), fields: [] }],
},
],
})
} else if (field.type === 'Section Break') {
_sections.push({
label: field.label,
name: field.value,
columns: [{ fields: [] }],
columns: [{ name: 'column_' + getRandom(), fields: [] }],
})
} else if (field.type === 'Column Break') {
_sections[_sections.length - 1].columns.push({

View File

@ -130,7 +130,8 @@
sections.push({
label: __('New Section'),
opened: true,
columns: [{ fields: [] }],
name: 'section_' + getRandom(),
columns: [{ name: 'column_' + getRandom(), fields: [] }],
})
"
>
@ -145,6 +146,7 @@
import EditIcon from '@/components/Icons/EditIcon.vue'
import Autocomplete from '@/components/frappe-ui/Autocomplete.vue'
import DragVerticalIcon from '@/components/Icons/DragVerticalIcon.vue'
import { getRandom } from '@/utils'
import Draggable from 'vuedraggable'
import { Input, createResource } from 'frappe-ui'
import { computed, watch } from 'vue'