this.$store.dispatch('analyzesDetail', id).then(() => { this.temp = this.$store.state.nlp.analyzesDetail.content; //... });我在analyzesDetail這個action完成以后取獲得state里面的analyzesDetail,為什么還是之前的數(shù)據(jù)?actionanalyzesDetail({commit}, id){ return new Promise((resolve, reject) => { setTimeout(() => { request( { method: 'get', url: `/agent/nlp/analyze/${id}`, }, {type: nlpTYPE.ANALYZES_DETAIL}, {type: nlpTYPE.ANALYZES_DETAIL_ERROR, message: '獲取分析詳細(xì)失敗'}, commit); resolve() }, 100) })},const mutations = {[nlpTYPE.SEGMENT] (state, payload) { state.segment = payload;},[nlpTYPE.ANALYZE] (state, payload) { state.analyze = payload;},[nlpTYPE.CURRENT_ANALYZE] (state, payload) { state.currentAnalyze = payload;},
添加回答
舉報
0/150
提交
取消