浏览代码

more comments

Evan You 9 年之前
父节点
当前提交
a4dc0ad700
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      examples/counter/Counter.vue

+ 5 - 0
examples/counter/Counter.vue

@@ -14,6 +14,11 @@ import vuex from './vuex'
 export default {
   data () {
     return {
+      // this is how we connect the component's state to
+      // a part of vuex's state tree. `vuex.get()` returns
+      // a Cursor, which is essentially an event emitter that
+      // lets you subscribe to value changes. When Vuex is used,
+      // Vue instances knows how to handle Cursors inside data.
       count: vuex.get('count')
     }
   },