[Vuejs]-Vuetify group of checkboxes returns all true

1👍

If you want to store checked objects as strings from filter.value property so you have 2 issues in your code(second one is related to your question):

  1. You have incorrect value in your v-model directive. You bind filter.model variable to v-model not its stored array name, to fix this you should pass to v-model something like this $data[filter.model] to bind array from data as model dynamically.

  2. You use input-value binding incorrectly. input-value is related to v-model value(see v-checkbox source code, it’s overriding of default model), you don’t need to change this value. So you need to pass filter.value to value attribute instead.

Result:

<v-checkbox :value="filter.value" :label="filter.title" v-model="$data[filter.model]" color="primary"></v-checkbox>

Leave a comment