state: { teamA: ‘主队‘ }, mutations: { data_teamA(state, x) { state.teamA = x } },
state: { teamA: JSON.parse(sessionStorage.getItem("teamA")) || ‘主队‘ }, mutations: { data_teamA(state, x) { sessionStorage.setItem(‘teamA‘, JSON.stringify(x)) state.teamA = x } },
原文:https://www.cnblogs.com/Leophen/p/11817043.html