Browse Source

small middleware tweak

Evan You 9 năm trước cách đây
mục cha
commit
d74fd83279
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      examples/todomvc/vuex/middlewares.js

+ 2 - 2
examples/todomvc/vuex/middlewares.js

@@ -1,7 +1,7 @@
 import { STORAGE_KEY } from './index'
 
 export default [{
-  after: function (action, state) {
-    localStorage.setItem(STORAGE_KEY, JSON.stringify(state.todos))
+  after: function (mutation, { todos }) {
+    localStorage.setItem(STORAGE_KEY, JSON.stringify(todos))
   }
 }]