Question 26
Consider the below Vue component and a Vuex store implementation.
const store = new Vuex.Store({ state: { count: 0, total_cost: 0, products: [], },
mutations: { update_total_cost : Placeholder2 }})
Vue.component("product", { template : `<div> Assume some code </div>`,
methods : { update_store_cost : function (count, price) { Placeholder1
}, }})You are supposed to invoke the mutation function “update_total_cost” from the method named “update_store_cost” of the Vue component “product”. The “update_total_cost” mutation function should update the store data variable “total_cost” with an appropriate value. The cost is the product of “count” and “price” parameters of the function “update_store_cost”. Assume that both these parameters are of Numeric type, and need not be typecasted.
Which of the following is/are the possible replacements for “placeholder1” and “placeholder2”?