0👍
✅
Until your SET_SHOP_ITEM_CATEGORIES
mutation is executed, your getter will use whatever initial data you have in your module’s state
. If that ShopItemsCategories.data
property is not defined, you will get the reported error message when your computed property executes.
The simple solution is to define some initial state that makes sense for the rest of your app.
For example
state: {
ShopItemsCategories: {
data: []
}
}
Source:stackexchange.com