1、
存储数据:
var storage = window.sessionStorage
storage.setItem("user","username")
取出数据:
var storage = window.sessionStorage
var str = storage.getItem("user");
var user = JSON.parse( str );
console.log(str)
2、
Ant Design
定义组件
import { ACCESS_TOKEN } from '@/store/mutation-types'
import Vue from 'vue'
存储数据:
Vue.ls.set('resu', result, 7 * 24 * 60 * 60 * 1000)
取出数据:
Vue.ls.get('resu')