[Vuejs]-Accessing vuex store state array details in another Vue component

0👍

so I made details as separate states in getters like this:


 setTitle: state =>{
           let oneItem=''
            state.cart.forEach((item)=>{
                oneItem=item.ropeTitle
            })

            return oneItem
        },

and then I used it in a component like this:

title : this.$store.getters.setTitle,

Leave a comment