I am having an issue with my Vuex implementation. I have a getter that retrieves an array which I use in a Vuetify drop down select component. My goal is to insert an additional property at the beginning of the array, but when I try to do so, only a number is returned from my computed property.
Below is the relevant code:
Vuetify Select Component:
<v-select
v-on:change="setGame"
v-model="gameid"
:items="games"
item-text="gametitle"
item-value="gid"
label="Select Game"
></v-select>
Computed Property for 'games':
games(){
return this.$store.getters.games.unshift({ 'gametitle': 'All Games', gid: null });
}
The original working return statement:
return this.$store.getters.games
Error Message:
[Vue warn]: Invalid prop: type check failed for prop "items". Expected Array, got Number with value 3.
found in
---> <VSelect>
<VToolbar>
<Navbar> at src/components/layout/Navbar.vue
<VApp>
<App> at src/App.vue
<Root>