How to modify the Container Element Type? #41
-
Hello everyone, When I try to customise element: {
types: {
container: {
sections: {
properties: {
name: 'properties',
label: 'Properties',
fields: {
type: { type: TypeField },
name: { type: NameField },
label: { type: LabelField },
tooltip: { type: InfoField },
description: { type: DescriptionField },
customType: { type: InputTypeField },
},
},
data: {
name: 'data',
label: 'Data',
fields: {
nested: { type: NestedField },
},
},
decorators: {
name: 'decorators',
label: 'Decorators',
fields: {
before: { type: BeforeField },
between: { type: BetweenField },
after: { type: AfterField },
},
},
layout: {
name: 'layout',
label: 'Layout',
fields: {
size: { type: SizeField },
columns: { type: ColumnsField },
},
},
conditions: {
name: 'conditions',
label: 'Conditions',
fields: {
conditions: { type: ConditionsField },
},
},
},
separators: {
properties: [
['type', 'name'],
['label', 'tooltip'],
['description'],
],
layout: [
['size'],
['columns'],
],
}
},
}
} Container disappears from the elements. It works for P.S.: also I tried to add custom properties field to |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Apologies @dan-leech - I overlooked this discussion and forgot to reply. I tested and it really seems like a bug - will be fixed. I've created an issue for it: #43 |
Beta Was this translation helpful? Give feedback.
-
Actually, I figured out the problem is that you don't only need the If you don't want to change any of these properties this is the best practice: // builder.config.js
import { elementTypes } from '@vueform/builder'
export default {
element: {
types: {
container: {
...elementTypes.container,
sections: {
properties: {
name: 'properties',
label: 'Properties',
fields: {
type: { type: TypeField },
name: { type: NameField },
label: { type: LabelField },
tooltip: { type: InfoField },
description: { type: DescriptionField },
customType: { type: InputTypeField },
},
},
data: {
name: 'data',
label: 'Data',
fields: {
nested: { type: NestedField },
},
},
decorators: {
name: 'decorators',
label: 'Decorators',
fields: {
before: { type: BeforeField },
between: { type: BetweenField },
after: { type: AfterField },
},
},
layout: {
name: 'layout',
label: 'Layout',
fields: {
size: { type: SizeField },
columns: { type: ColumnsField },
},
},
conditions: {
name: 'conditions',
label: 'Conditions',
fields: {
conditions: { type: ConditionsField },
},
},
},
separators: {
properties: [
['type', 'name'],
['label', 'tooltip'],
['description'],
],
layout: [
['size'],
['columns'],
],
}
},
}
}
} |
Beta Was this translation helpful? Give feedback.
-
@adamberecz Thanks. |
Beta Was this translation helpful? Give feedback.
-
It should be possible. The keys for static elements are:
What's the issue you're encountering? |
Beta Was this translation helpful? Give feedback.
Actually, I figured out the problem is that you don't only need the
sections
andseparators
properties, but everything else, likelabel
,icon
,category
, etc. And from the missingcategory
is the reason why it does not belong to any category and thus not being rendered.If you don't want to change any of these properties this is the best practice: