Vuex state not updating from fetch
const fetchCartItems = () => { store.dispatch(‘cart/fetchCartItems’); }; const cartItems = computed(() => store.getters[‘cart/cartItems’]); console.log(‘Products is : ‘, cartItems.value); watch(cartItems, (newValue) => { console.log(‘Cart items updated:’, newValue); }); onMounted(() => { fetchCartItems(); // Učitaj proizvode kada se komponenta montira }); return { cartItems, }; Everything works in vuex. It downloads data from the server, but […]