Hi,
I have installed f7vue v6 tabed layout.
In “catalog” tab, then I click on list item, I get an error.
It is store bug or code mistake?
“Uncaught (in promise) TypeError: products.forEach is not a function”
Image attached:
Hi,
I have installed f7vue v6 tabed layout.
In “catalog” tab, then I click on list item, I get an error.
It is store bug or code mistake?
“Uncaught (in promise) TypeError: products.forEach is not a function”
Image attached:
I have added “value” and it works.
before:
products.forEach(function (product) {
if (product.id === productId) {
currentProduct = product
}
})
after:
products.value.forEach(function (product) {
if (product.id === productId) {
currentProduct = product
}
})
Is something wrong with useStore?
In docs written “useStore(getterName)- returns directly getter value”
It must be used with .value
, same as refs
in Vue 3