我有一個(gè)有點(diǎn)奇怪的問題..我無(wú)法返回處于 vuex“狀態(tài)”的對(duì)象中的特定屬性。為了更好地理解,我將在下面放一個(gè)我的商店的片段:state: { activeIdentifier: '', //controlar qual modulo que esta ativo configListActive: { entity: {} }, //controla qual instancias que esta ativa na visao listController: {}, //instancias dos controllers filterParams:{}, //params de filtros feitos }, getters: { configListActive: state => param =>{ console.log("State:", state.configListActive) console.log("Param:", param) console.log("Result:", state.configListActive[param]) return state.configListActive[param]; }, filterParams: state => param => { return state.filterParams[param]; }, listController: state => param => { return state.listController[param]; } },[....]我在 getter“configListActive”中傳遞一個(gè)參數(shù),并且我的對(duì)象“configListActive”存在該屬性,但是返回是“未定義”,我將把它放在我所做的調(diào)試的打印下面。
Vuex getter 未定義,但狀態(tài)出現(xiàn)在控制臺(tái)中
慕萊塢森
2023-08-18 16:49:06