Closed pastorryanhayden closed 6 years ago
This is what my Object looks like:
{
"name": "Space Available",
"model": {
"floors": [null]
},
"schema": {
"fields": [{
"type": "array",
"label": "Space Per Floor",
"model": "floors",
"showRemoveButton": false,
"fieldClasses": "arrayEditor",
"newElementButtonLabelClasses": "button is-primary",
"items": {
"type": "object",
"default": {},
"schema": {
"fields": [{
"type": "input",
"inputType": "text",
"label": "Floor Number",
"model": "floor_number"
}, {
"type": "input",
"inputType": "text",
"label": "Common Area Fact",
"model": "common_area_fact"
}, {
"type": "input",
"inputType": "number",
"label": "Ammount (Sq. Ft)",
"model": "ammount_sq_ft"
}]
}
}
}]
}
}
I'm using this in Nuxt if that helps.
I figured it out. I had to install it as a plugin in the nuxt plugin folder:
plugins/vueformgen.js
import Vue from "vue";
import VueFormGenerator from "vue-form-generator";
import {FieldArray} from 'vfg-field-array';
Vue.component('VueFormGenerator', VueFormGenerator.component)
Vue.component('FieldArray', FieldArray);
Then register it in nuxt.config.js:
plugins: [
'~/plugins/vueformgen'
],
I'm getting these two errors:
and
My component looks like this: