1▶// Full spec-compliant TodoMVC with localStorage persistence
2// and hash-based routing in ~150 lines.
3
· · ·
4// localStorage persistence
5▶var STORAGE_KEY = 'todos-vuejs-2.0'
6var todoStorage = {
7 fetch: function () {
· · ·
6▶var todoStorage = {
7 fetch: function () {
8 var todos = JSON.parse(localStorage.getItem(STORAGE_KEY) || '[]')
· · ·
8▶ var todos = JSON.parse(localStorage.getItem(STORAGE_KEY) || '[]')
9 todos.forEach(function (todo, index) {
10 todo.id = index
· · ·
9▶ todos.forEach(function (todo, index) {
10 todo.id = index
11 })
+ 47 more matches in this file