I need to sort the array which I am receiving after Axios and I need to sort value in ascending and descending also by the date. I don't really know how Vuex works and I need to create the sort function really fast. Can you guys please help me out?
methods: {
sort() {
return this.results = this.$store.getters.getResults.slice().reverse();
},
}
const actions = {
sort({commit}, payLoad){
commit('setResults', )
},
const mutations = {
setResults (state, results) {
state.results = results
},
}
Can you tell me if I am doing correctly? I need to sort the array by its title.