|
@@ -142,7 +142,7 @@ const store = new Vuex.Store({ ...options })
|
|
|
|
|
|
- **`watch(getter: Function, cb: Function, options?: Object)`**
|
|
|
|
|
|
- 响应式地监测一个 getter 方法的返回值,当值改变时调用回调函数。getter 接收 store 的状态作为唯一参数。接收一个可选的对象参数表示 Vue 的 `vm.$watch` 方法的参数。
|
|
|
+ 响应式地监测一个 getter 方法的返回值,当值改变时调用回调函数。Getter 接收 store 的 state 作为第一个参数,其 getter 作为第二个参数。最后接收一个可选的对象参数表示 Vue 的 `vm.$watch` 方法的参数。
|
|
|
|
|
|
要停止监测,直接调用返回的处理函数。
|
|
|
|