[Vuejs]-Getting "Cannot read property 'map' of undefined error while calling reset()" in vue JS in below file

0👍

when you are calling the reset().

store.commit('SearchResult',[]) executing with an empty array,

but into setResults:(state, results), here results is an empty array so results has no siteList attribute. so this is the cause of error.

so consider the setResults function code when results is an empty array.

Leave a comment