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):
-
You have incorrect value in your
v-model
directive. You bindfilter.model
variable tov-model
not its stored array name, to fix this you should pass tov-model
something like this$data[filter.model]
to bind array fromdata
as model dynamically. -
You use
input-value
binding incorrectly.input-value
is related tov-model
value(seev-checkbox
source code, it’s overriding of default model), you don’t need to change this value. So you need to passfilter.value
tovalue
attribute instead.
Result:
<v-checkbox :value="filter.value" :label="filter.title" v-model="$data[filter.model]" color="primary"></v-checkbox>
Source:stackexchange.com