console.log(this.$store.getters.getCheckedFiles());getters: {getCheckedFiles: state => {
return state.files.filter(checked => checked.checked);
// return ids;
}}代碼如圖,無論是在vue組件中調用還是main.js的mutations里面調用均提示Uncaught TypeError: Cannot read property 'getCheckedFiles' of undefinedUncaught TypeError: this.$store.getters.getCheckedFiles is not a function
3 回答

Alice_hhu
TA貢獻3條經驗 獲得超1個贊
getters 是屬性,不是方法,直接訪問,而不是用方法的調用方式
console.log(this.$store.getters.getCheckedFiles);