I need to access this Json object
"savings": {
"1": {
"id": 111,
"name": "savings A"
},
"2": {
"id": 123,
"name": "savings B"
},
},
to display it on a mutiselect:
<div class="form-group row">
<label class="col-sm-4 col-form-label text-right">Savings:</label>
<div class="col-sm-6">
<multiselect2
v-model="savings"
track-by="name"
label="name"
:options="savings_list"
:allow-empty="false"
:searchable="true">
</multiselect2>
</div>
</div>
////
data: () => ({savings_list: [], savings: null});
////
axios.get('/api/)
.then(response => {
this.savings_list = response.data.savings;
this.savings = this.savings_list.find(f => f.id>=0);}
I tried to declare savings as but no luck
savings_list: {array: {}}
I did this same process for other arrays and there was no issue, the problem here is I don´t know how to access this Json object using Vue. When I run the code I get this errors:
Invalid prop: type check failed for prop "options". Expected Array, got Object
[Vue warn]: Error in getter for watcher "filteredOptions": "TypeError: this.options.concat is not a function"
I've been stuck trying to fix this for hours, any help is more than welcome.