lundi 25 septembre 2017

Vue not getting array values

If I select a checkbox vue does not give any values to the array, even though the items have a value as I checked the DOM Tree.

<div class="column">
    <div class="card">
        <div class="card-content">
            <label for="players" class="label"></label>
            <input type="hidden" name="players" :value="playerSelected">

            <b-checkbox-group v-model="playerSelected">
                @foreach ( $players as $player )
                <div class="field">
                    <b-checkbox :custom-value=""></b-checkbox>
                </div>
                @endforeach
            </b-checkbox-group>
        </div>
    </div>
</div><!--column-->

<script>
    var app = new Vue({
        el: '#app',
        data: {
            playerSelected: {!! $team->players->pluck('id') !!},
            gameSelected: {!! $team->games->pluck('id') !!}
        }
    });
</script>




Aucun commentaire:

Enregistrer un commentaire