fix: do not use dynamic class for grid columns
This commit is contained in:
parent
68b6b4a07d
commit
35a299b4d8
@ -119,9 +119,7 @@
|
|||||||
group="fields"
|
group="fields"
|
||||||
item-key="label"
|
item-key="label"
|
||||||
class="grid gap-1.5"
|
class="grid gap-1.5"
|
||||||
:class="
|
:class="gridClass(section.columns)"
|
||||||
section.columns ? 'grid-cols-' + section.columns : 'grid-cols-3'
|
|
||||||
"
|
|
||||||
handle=".cursor-grab"
|
handle=".cursor-grab"
|
||||||
>
|
>
|
||||||
<template #item="{ element: field }">
|
<template #item="{ element: field }">
|
||||||
@ -349,6 +347,17 @@ function getSectionOptions(section) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function gridClass(columns) {
|
||||||
|
columns = columns || 3
|
||||||
|
let griColsMap = {
|
||||||
|
1: 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-1',
|
||||||
|
2: 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-2',
|
||||||
|
3: 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-3',
|
||||||
|
4: 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-4',
|
||||||
|
}
|
||||||
|
return griColsMap[columns]
|
||||||
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.doctype,
|
() => props.doctype,
|
||||||
() => fields.fetch(params.value),
|
() => fields.fetch(params.value),
|
||||||
|
|||||||
@ -63,7 +63,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<ComboboxOptions
|
<ComboboxOptions
|
||||||
class="my-1 max-h-[12rem] overflow-y-auto px-1.5"
|
class="my-1 max-h-[12rem] overflow-y-auto p-1.5 pt-0"
|
||||||
static
|
static
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user