How to bind MDBChipsInput chips property to object property?


Topic: How to bind MDBChipsInput chips property to object property?

Святослав Иванов pro premium priority asked 2 years ago

How to bind MDBChipsInput chips property to object property?

I need to update creativeModel.words property after user update chips in form.

I will try this code and has no result

<MDBRow tag="form" ref="form" class="g-3 needs-validation" novalidate @submit.prevent="checkForm">
      <MDBCol md="12">
        <MDBInput
            label="Название"
            v-model="creativeModel.name"
            invalidFeedback="Это обязательное поле"
            required
        />
      </MDBCol>
      <MDBCol md="12">
        <MDBChipsInput
            label="Слова"
            v-model:chips="creativeModel.words"
            invalidFeedback="Это обязательное поле"
            required
            editable
        />
      </MDBCol>

Mateusz Trochonowicz staff pro premium priority answered 2 years ago

Hi! There is no necessary to use MDBChipsInput component. Moreover, chips property is reserved only for array (check out our documentation). For dynamically changing value of Chip you can simply use basic version: <MDBChip>{{yourvalue.here}}</MDBChip>.

Keep coding!


Святослав Иванов pro premium priority answered 2 years ago

Maybe I didn't put it quite right.

I have an object with an array property. I need the user to enter words in the interface and new words are written to this array. Maybe there is a more specific link?


Mateusz Trochonowicz staff pro premium priority commented 2 years ago

Now I understand. Unfortunately our MDBChip component does not support right now dynamically added values. Thanks for letting us know. We will discuss this in our team.

Keep coding!


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB Vue
  • MDB Version: MDB5 3.1.1
  • Device: Macbook
  • Browser: Chrome
  • OS: MacOs
  • Provided sample code: No
  • Provided link: No