J
J
jeruthadam2019-07-14 14:49:20
Vue.js
jeruthadam, 2019-07-14 14:49:20

How to make checkbox component work with boolean and array?

I'm trying to make a simple checkbox wrapper. A simple true / false was given without problems, but what about when you need to pass non-Boolean values ​​in a loop and push the marked ones into the selected array?
https://codepen.io/anon/pen/bPyYmr
_ so that component usage looks like

<v-checkbox
      v-model="selected"
      v-for="a in array"
      :key="a.id"
      :label="a.name"
    />

And at the same time, would it work with single checkboxes with Boolean, and with such a loop with an array?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
0
0xD34F, 2019-07-14
@jeruthadam

https://jsfiddle.net/hecLskof/

D
Decadal, 2017-10-12
@Decadal

Have you started composer?
php composer.phar install

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question