728x90
localStorage
json data (SET, GET)
localStorage.setItem('SET_MENU_ALL', JSON.stringify(treeMenu));
const storedData = JSON.parse(localStorage.getItem('treeMenu'));
SET, GET
localStorage.setItem('SET_MENU_ALL', treeMenu);
const storedData = localStorage.getItem('treeMenu');
Delete
localStorage.removeItem('SET_MENU_ALL')
sessionStorage (브라우저 끄면 사라짐)
sessionStorage.setItem('SET_MENU_ALL', treeMenu)
sessionStorage.getItem('SET_MENU_ALL')
sessionStorage.removeItem('SET_MENU_ALL')
728x90
'VUE' 카테고리의 다른 글
vue 자식컴포넌트 object 타입 선언 및 초기화 (0) | 2023.09.20 |
---|---|
vue3 firebase fileupload download (0) | 2023.09.17 |
vue.js 에서 router 호출 전 store 에 저장하기 (0) | 2023.05.11 |
vue.js 에서 파일 업로드 이미지파일 미리보기 구현 예제 (0) | 2023.05.09 |
git checkout 브랜치 이동 안될때 (0) | 2023.05.02 |