samedi 23 avril 2016

Error with checkboxes: this.cb.call underfined

I'm running into an error with checkboxes. It doesn't seem to be having any negative effect at the moment, but I'm sure I'm doing something wrong since I'm getting the following error in my console:

admin.js:40393 Uncaught TypeError: this.cb.call is not a functionWatcher.run @ admin.js:40393runBatcherQueue @ admin.js:40121flushBatcherQueue @ admin.js:40099nextTickHandler @ admin.js:37552

Here's my code:

<field-checkbox :label="role.label" :error="getError('input.roles')" :value="role.name" :model.sync="input.roles" v-for="role in roles"></field-checkbox>

which resolves to:

<template>
    <div class="checkbox" :class="{'has-error': (error)}">
        <label class="control-label">
            <input type="checkbox" v-model="model" value="" v-el:field> 
        </label>
        <span class="help-block" v-text="(showError) ? error : ''"></span>
        <slot></slot>
    </div>
</template>

<script>
    var dispatchesRules = require('../../mixins/dispatchesRules.js');

    module.exports = {
        mixins: [dispatchesRules],
        props: {
            label: {},
            model: {},
            error: {},
            options: {},
            value: {},
            showError: {
                type: Boolean,
                default: true
            }
        }
    }
</script>

The checkbox data seems to be bound to input.roles properly, and checking/unchecking the checkbox does update the array. It seems like Vue is expecting to be able to call a .call() function on the model which doesn't exist. Has anyone had any issues like this before?




Aucun commentaire:

Enregistrer un commentaire