keepAliveNames.js 429 B

1234567891011121314151617181920
  1. const keepAliveNamesModule = {
  2. namespaced: true,
  3. state: {
  4. keepAliveNames: [],
  5. },
  6. mutations: {
  7. // 设置路由缓存(name字段)
  8. getCacheKeepAlive(state, data) {
  9. state.keepAliveNames = data;
  10. },
  11. },
  12. actions: {
  13. // 设置路由缓存(name字段)
  14. async setCacheKeepAlive({ commit }, data) {
  15. commit('getCacheKeepAlive', data);
  16. },
  17. },
  18. };
  19. export default keepAliveNamesModule;