user7693832
user7693832

Reputation: 6849

The params can't pass to vuex's update method

in store.js:

const actions { 
...
  
update_search_condition_params_delete_params({commit}, {delete_search_condition_params}){
    
  console.log("delete_search_condition_params: = ", 
  delete_search_condition_params)  // Line 101
    
  commit('mutations_search_condition_params_delete_params', delete_search_condition_params)
  }
}


when I dispatch the update method of store in my code,

console.log("sc_style: ", this.sc_style)  // there have a item


this.$store.dispatch('update_search_condition_params_delete_params', this.sc_style)

but when I test it I get error:

enter image description here

you see the delete_search_condition_params = undefined.

Upvotes: 0

Views: 20

Answers (1)

Elnatal Debebe
Elnatal Debebe

Reputation: 286

try this.

const actions {
  update_search_condition_params_delete_params(vuexContext, delete_search_condition_params) {      
     vuexContext.commit('mutations_search_condition_params_delete_params', delete_search_condition_params)

  }
}

Upvotes: 1

Related Questions