Topic: How to bind MDBChipsInput chips property to object property?
Святослав Иванов 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>
Святослав Иванов priority answered 1 year 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 commented 1 year 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!
Mateusz Trochonowicz staff 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!
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
- 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