使用js-cookie工具:
1.npm i js-cookie //安装
2.import Cookies from 'js-cookie' //引用
// 存入cookie:
Cookies.set('token','value')
// 获取cookie:
Cookies.get('token')
//删除cookie:
Cookies.remove('token')
使用js-cookie工具:
1.npm i js-cookie //安装
2.import Cookies from 'js-cookie' //引用
// 存入cookie:
Cookies.set('token','value')
// 获取cookie:
Cookies.get('token')
//删除cookie:
Cookies.remove('token')