From 45aac151d72f4417e08fe6536ca5a85af6d6ed0e Mon Sep 17 00:00:00 2001 From: xiaomi <391147815@qq.com> Date: Fri, 20 Jul 2018 15:50:49 +0800 Subject: [PATCH 1/2] setLocalStorgae -> setLocalStorage --- .../dashboard/admin/components/TodoList/index.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/views/dashboard/admin/components/TodoList/index.vue b/src/views/dashboard/admin/components/TodoList/index.vue index 34f0241d..207cdbab 100644 --- a/src/views/dashboard/admin/components/TodoList/index.vue +++ b/src/views/dashboard/admin/components/TodoList/index.vue @@ -72,7 +72,7 @@ export default { } }, methods: { - setLocalStorgae() { + setLocalStorage() { window.localStorage.setItem(STORAGE_KEY, JSON.stringify(this.todos)) }, addTodo(e) { @@ -82,30 +82,30 @@ export default { text, done: false }) - this.setLocalStorgae() + this.setLocalStorage() } e.target.value = '' }, toggleTodo(val) { val.done = !val.done - this.setLocalStorgae() + this.setLocalStorage() }, deleteTodo(todo) { this.todos.splice(this.todos.indexOf(todo), 1) - this.setLocalStorgae() + this.setLocalStorage() }, editTodo({ todo, value }) { todo.text = value - this.setLocalStorgae() + this.setLocalStorage() }, clearCompleted() { this.todos = this.todos.filter(todo => !todo.done) - this.setLocalStorgae() + this.setLocalStorage() }, toggleAll({ done }) { this.todos.forEach(todo => { todo.done = done - this.setLocalStorgae() + this.setLocalStorage() }) } }, From 99d1043f42a5040a474e38d2abdc48a0d220b107 Mon Sep 17 00:00:00 2001 From: xiaomi <391147815@qq.com> Date: Wed, 25 Jul 2018 12:31:59 +0800 Subject: [PATCH 2/2] mutations DEL_OTHERS_VIEWS state.cachedViews -> i type is string slice(begin: number, end: number) --- src/store/modules/tagsView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/modules/tagsView.js b/src/store/modules/tagsView.js index 06d092c9..25d513cd 100644 --- a/src/store/modules/tagsView.js +++ b/src/store/modules/tagsView.js @@ -38,7 +38,7 @@ const tagsView = { for (const i of state.cachedViews) { if (i === view.name) { const index = state.cachedViews.indexOf(i) - state.cachedViews = state.cachedViews.slice(index, i + 1) + state.cachedViews = state.cachedViews.slice(index, index + 1) break } }