|
|
@@ -18,6 +18,7 @@ var uid = 0
|
|
|
* - {Boolean} twoWay
|
|
|
* - {Boolean} deep
|
|
|
* - {Boolean} user
|
|
|
+ * - {Boolean} sync
|
|
|
* - {Function} [preProcess]
|
|
|
* @constructor
|
|
|
*/
|
|
|
@@ -34,6 +35,7 @@ function Watcher (vm, expOrFn, cb, options) {
|
|
|
this.deep = !!options.deep
|
|
|
this.user = !!options.user
|
|
|
this.twoWay = !!options.twoWay
|
|
|
+ this.sync = !!options.sync
|
|
|
this.filters = options.filters
|
|
|
this.preProcess = options.preProcess
|
|
|
this.deps = []
|
|
|
@@ -160,7 +162,7 @@ p.afterGet = function () {
|
|
|
*/
|
|
|
|
|
|
p.update = function () {
|
|
|
- if (!config.async) {
|
|
|
+ if (this.sync || !config.async) {
|
|
|
this.run()
|
|
|
} else {
|
|
|
batcher.push(this)
|