1

我从 API 中获取了大约 500 个对象数组,我尝试通过变异提交将它们保存在状态中,我面临上述错误。

动作.js

export const fetchUserLessons = ({commit, getters}) => {
  let params = {
    companyId: getters.companyId,
    token: getters.getAccessToken
  }
  return getUserLessonDelta(params).then(response => {
    let batch = new BatchProcess(getUserLessons, params, response.data)
    return batch.process()
  }).then(response => {
    let userLessons = new UserLessons(response, getPdfUrl, params)
    commit('SET_LESSONS', userLessons)
  }).catch(error => {
    commit('ERROR', error)
  })
}

突变.js

SET_LESSONS (state, payload) {
    state.lessons = payload.all
    state.done = payload.completed
    state.pending = payload.pending
    state.featured = payload.featured
}

错误

vuex-persistedstate.umd.js?5086:1 Uncaught (in promise) DOMException: Failed to execute 'setItem' on 'Storage': 设置 'vuex' 的值超出了配额。

4

0 回答 0