I am trying to use multiple checkboxes in single file component. And I need to computed property, but I have boolean newVal instead of array in my setter. Here is my code:>
Here it is the working version:
var demo = new Vue({
el: '#demo',
data: {
checkedNames: []
}
})
Checked names: {{ checkedNames }}
if you want to use a computed property you can use it in this way:
var demo = new Vue({
el: '#demo',
data: {
checkedNames: []
},
computed : {
checkedComputed () {
return this.checkedNames
}
}
})
Checked Names :
{{ checkedComputed }}