mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-09 15:39:24 +08:00
fix: undefined length
This commit is contained in:
parent
9048b2a58b
commit
1e329bc2d2
@ -413,11 +413,14 @@ Grid.Row = observer((props) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Grid.Col = observer((props: any) => {
|
Grid.Col = observer((props: any) => {
|
||||||
const { cols } = useContext(GridRowContext);
|
const { cols = [] } = useContext(GridRowContext);
|
||||||
const schema = useFieldSchema();
|
const schema = useFieldSchema();
|
||||||
const field = useField();
|
const field = useField();
|
||||||
const w = schema?.['x-component-props']?.['width'] || 100 / cols.length;
|
let width = '100%';
|
||||||
const width = `calc(${w}% - 24px - 24px / ${cols.length})`;
|
if (cols?.length) {
|
||||||
|
const w = schema?.['x-component-props']?.['width'] || 100 / cols.length;
|
||||||
|
width = `calc(${w}% - 24px - 24px / ${cols.length})`;
|
||||||
|
}
|
||||||
const { isOver, setNodeRef } = useDroppable({
|
const { isOver, setNodeRef } = useDroppable({
|
||||||
id: field.address.toString(),
|
id: field.address.toString(),
|
||||||
data: {
|
data: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user