使用vuex管理的状态数据在刷新页面后数据丢失的问题

一、现象

第一次请求url,可以获取到数据

 刷新页面后:

二、代码实现逻辑

通过mounted钩子函数加载数据

 通过computed获取store中的状态

 加载数据调用的方法

 store中的actions对象

 mutations对象

 state对象:

 axios请求

 解决方法:??????

原文地址:https://www.cnblogs.com/LAlexH/p/14329909.html