安装:

  npm install --save vuex-persistedstate

引用:

  import createPersistedState from 'vuex-persistedstate'

配置:

  new Vuex.Store({plugins: [createPersistedState()] })

作用:

  将 vuex 状态保存到 localstorage 中

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-11
  • 2022-12-23
相关资源
相似解决方案