在我的应用程序中,主页从我的其余API获取Json响应.然后我将产品添加到购物车数组中.最初,我的商店值是..
const DEFAULT_STATE_TRENDING = {
data:{},
specialoffdata:[],
banner:[],
offerstitle:[],
cart:[],
cartcount:0,
isFetching:false,
dataFetched:false,
error:false,
}
Run Code Online (Sandbox Code Playgroud)
添加产品后,购物车阵列和购物车数量变为..
cart:[{...},{...}],
cartcount:cart.length
Run Code Online (Sandbox Code Playgroud)
现在,我关闭我的应用程序.重新加载应用程序后,购物车数组变空.如何在此处保留商店值?