Vue-form-generator: What is wrong in my vueMultiSelect

Created on 29 Jan 2019  路  4Comments  路  Source: vue-generators/vue-form-generator

When i try remove the tag added in my multi select the options multiplies in my input automaticaly.
I get this reference in doc-site
image

{
    type: "vueMultiSelect",
    model: "cid10",
    label: "cid10",
    placeholder: "Busque uma doen莽a",
    required: true,
    validator: VueFormGenerator.validators.required,
    selectOptions: {
        multiple: true,
        key: "code",
        label: "name",
        searchable: true,
        taggable: true,
        tagPlaceholder: "Adicione o c贸digo",
        onNewTag: function(newTag, id, options, value) {
            const tag = {
                name: newTag,
                code: newTag.substring(0,2) + Math.floor((Math.random() * 10000000))
            };
            options.push(tag);
            value.push(tag);
        }
    },
    onChanged: function(model,newVal,oldVal,field) {
        console.log('@tag:', newVal);
    },
    values: [

    ]
}

Most helpful comment

I've actually found out the solution and I think the documentation needs updating, but in essence, the property "trackBy" needs to be added to selectOptions, when using JSON objects as values.

All 4 comments

@Atiladanvi Did you find your solution?

I had a similar issue that was related to the version of Vue-Multiselect I was using (i.e. the latest version) however, downgrading to an earlier version (2.0.0-beta) fixes the issue but brings about another issue. There seems to be an incompatibility issue between the beta version of vue-multiselect and the latest vue-generator though.

Post your code.

I've actually found out the solution and I think the documentation needs updating, but in essence, the property "trackBy" needs to be added to selectOptions, when using JSON objects as values.

You can submit a pull request about that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Stephen9s picture Stephen9s  路  4Comments

gkurdej picture gkurdej  路  5Comments

jaywilburn picture jaywilburn  路  3Comments

kiankji picture kiankji  路  4Comments

pimhooghiemstra picture pimhooghiemstra  路  5Comments