Skip to content

Custom element fix #10

Description

@electromuis

I had an issue with this config

data () {
            return {
                valid: false,
                success: false,
                loading: true,
                message: "",
                model: {
                    tournamentManagers: []
                },
                schema: {
                    fields: [
                        {
                            type: "array",
                            model: "tournamentManagers",
                            items: {
                                type: "select",
                                values: []
                            }
                        }
                    ]
                },
                formOptions: {
                    validateAfterLoad: true,
                    validateAfterChanged: true,
                    validateAsync: true
                }
            }
        },

It told me it couldnt find the element "field-select", which comes from

getFieldType(fieldSchema) {
        return "field-" + fieldSchema.type;
      },

Thats becuase the components property in the array element is not there, fixed by by ovveriding that at import

import fieldArray from "vfg-field-array/src/components/field-array.vue";

import fieldComponents from "vue-form-generator/src/utils/fieldsLoader.js";
fieldArray.components = fieldComponents

Vue.component("fieldArray", fieldArray);

But of course it would be better if this could be fixed in the module itself

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions