Skip to content

Problem with sub-object #105

@eduardodallmann

Description

@eduardodallmann

If v-model has a sub-object it causes an error.

<model-list-select
      :list="clients"
      option-value="id"
      option-text="name"
      v-model="form.client"
      placeholder="Solicitante"
      class="form-control col-md-7 col-xs-12"
    ></model-list-select>
data() {
    return {
      clients: [{ id: 1, name: "client1" }, { id: 2, name: "client2" }],
      form: {}
    };
  },

How to reproduce the problem: Choose one of the options, then use the delete key to erase the choice.

https://codesandbox.io/s/qklw33onq9

I would like to get a result like this. form: { "client": 2 }
I have other inputs in this form and it is easier to send an entire object in the axios params.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions