cartProducts (state, getters, rootState, rootGetters) {
            var result = state.items.map(cartItem => {
                const product = rootState.products.items.find(product => product.id === cartItem.id)
                return {
                    title: product.title,
                    price: product.price,
                    quantity: cartItem.quantity
                }
            })
            return result
        }
// sync data with computed in ShoppingCart component
sync data with computed in ShoppingCart component
sync data with computed in ShoppingCart component
cartProducts (state, getters, rootState, rootGetters) {
            var result = state.items.map(cartItem => {
                const product = rootState.products.items.find(product => product.id === cartItem.id)
                return {
                    title: product.title,
                    price: product.price,
                    quantity: cartItem.quantity
                }
            })
            return result
        }
cartProducts ( state , getters , rootState , rootGetters ) { var result = state . items . map ( cartItem => { const product = rootState . products . items . find ( product => product . id === cartItem . id ) return { title : product . title , price : product . price , quantity : cartItem . quantity } } ) return result }
sync data with computed in ShoppingCart component
sync data with computed in ShoppingCart component