react中將數據存放在緩存中的方法和將數據從緩存中取出的方法

數據放入緩存web localStorage.setItem('user',values.username); 緩存中取數據緩存 localStorage.getItem('user'); const weekArray = [‘週一’,‘週二’,‘週三’,‘週四’,‘週五’] 存:localStorage.setItem(‘weekDay’,JSON.stringify(weekArray));
相關文章
相關標籤/搜索