-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Closed
Description
store
export default new Vuex.Store({
getters:{
search(state,keyword){
//return state.items; //first question
//second question
return state.items.filter(item =>{
return item.name === keyword
});
}
}
})
component
export default {
name: 'items',
computed: {
search () {
return this.$store.getters.search
}
}
}
1.It don't work,why? According to this document
2.How to pass parameters to the function in getters?
Anand-Moghe, akoidan, internetztube, Peretz30, Samuelfaure and 19 moreeugenefvdm
Metadata
Metadata
Assignees
Labels
No labels