瀏覽器的Web Storage, 可以存儲和Cookie類似的值, 包括兩種類型:
1. sessionStorage, 會話存儲,會話期間存在。 瀏覽器關閉就沒有了
2. localStorage, 瀏覽器關閉依舊存在,
3.
```
//1. 保存
//1.1 字符串類型
const s = 'My Name is Oscar';
localStorage.setItem('myStr',s);
//1.2 對象類型
const myobj = {name:'Oscar'};
localStorage.setItem('myobj', JSON.stringify(myobj));
//2. 獲取
var myobjGet = JSON.parse(localStorage.getItem('myobj'));
var sGet = localStorage.getItem('myStr');
console.log(myobjGet.name);
console.log(sGet);
//3. 刪除
localStorage.removeItem('myobj');
localStorage.clear();
//4. 變換監聽, 增加、更新、刪除時觸發
window.addEventListener('storage',function(e){
console.log('key', e.key); //鍵
console.log('oldValue', e.oldValue); //舊值
console.log('newValue', e.newValue); //新值
console.log('url', e.url); //地址
});
```
- 引入篇
- 基礎篇
- 快速入手
- 名詞解釋
- Vue語法
- Vue安裝
- Vue實例
- 模板語法
- 計算屬性和偵聽器
- Class與Style綁定
- 條件渲染
- 列表渲染
- 事件處理
- 表單輸入綁定
- 組件基礎
- 進階篇
- 常用模塊
- 單文件組件
- 快速學會Vue Router路由
- Vue Route 進階使用
- Vuex 與狀態管理
- Axios
- Mock.js
- data數據顯示在頁面
- Vue生命周期
- Vue按需加載組件
- 國際化
- 頁面加載進度條 -NProgress
- 自定義主題顏色
- 開發篇
- Vue入門——創建并運行一個Vue項目
- Vue + Element UI 項目創建
- 使用Vue ui項目創建工具在網頁中創建Vue項目
- Vue項目創建入門實例
- Vue CLI
- 創建項目
- 使用Visual Studio Code 開發Vue項目
- 高級篇
- 組件深入
- Vue+Element
- Vue + ElementUI 主題顏色切換
- 工具篇
- 在線代碼編輯器
- 開發工具(IDE,集成開發環境)
- npm(JavaScript包管理工具)介紹
- Node.js(npm)在Windows下安裝
- webpack介紹
- webpack快速實例
- webpack
- 快速入門實例
- 安裝
- 概念
- Nodejs
- 基礎
- npm
- 命令參考
- 命令
- 模塊安裝
- Babel
- 問題解決篇
- ERROR Failed to get response from https://registry.yarnpkg.com/vue-cli-version -marker
- Vue常見問題
- You are using the runtime-only build of Vue where the template compiler is not
- yarn 報unable to get local issuer certificate
- yarn There appears to be trouble with your network connection. Retrying
- Expected Boolean, got String with value "true".
- 項目篇
- 項目創建
- 項目設計
- 頁面
- 開發問題
- 后端
- Spring Boot + Activiti 工作流框架搭建之一
- Spring Boot + Activiti 工作流框架搭建之二
- 工作流
- Java流程框架
- Activiti
- 頁面風格
- green
- blue
- orange
- 參考篇
- 好的Git項目
- Vue的在線js
- 指令
- 開發說明
- JavaScript 高級
- export和import
- JS模塊化規范對比以及在Node.js的實現
- Storage
- ES2015
- scss
- CSS、Sass、SCSS