Closed kahunacoder closed 6 years ago
You need to implement your schema this way (this is just an example) :
{
fields: [{
type: 'array',
label: 'Columns',
model: 'columns',
itemContainerComponent: 'AComponent', //optional
showRemoveButton: false, //optional
fieldClasses: 'arrayEditor', //optional
newElementButtonLabelClasses: 'button is-primary', //optional
items: {
type: 'object',
default: {},
schema: {
fields: [{
type: 'input',
label: 'Label',
model: 'label',
}, {
type: 'input',
label: 'Field',
model: 'field',
}],
},
},
}],
}
Does this answers your question?
No, my problem is with installing both modules into my main.js file.
import ModuleLibrary from 'vfg-field-array' Vue.use(ModuleLibrary);
and import ModuleLibrary from 'vfg-field-object'; Vue.use(ModuleLibrary)
Both modules are called ModuleLibrary
Ah ok.
I think I need to change those README.
Actually you can name "ModuleLibrary" whatever you want:
import VfgFieldArray from 'vfg-field-array'
Vue.use(VfgFieldArray);
and
import VfgFieldObject from 'vfg-field-object';
Vue.use(VfgFieldObject)
This "ModuleLibrary" name is just a variable you instanciate with the import. Is it more clear? Tell me, to know if I can close the issue.
Thank you that is what I needed to understand.
In the following example:
With container component and object as array item
You are using vfg-field-array and vfg-field-object. How do you install both? The docs say to do this in the main.js file
import ModuleLibrary from 'vfg-field-array'
Vue.use(ModuleLibrary);
and
import ModuleLibrary from 'vfg-field-object';
Vue.use(ModuleLibrary);
How do you use both?