File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ module.exports = function (config) {
19
19
ignore : [
20
20
'test/' ,
21
21
'src/compiler/parser/html-parser.js' ,
22
- 'src/core/instance/proxy.js'
22
+ 'src/core/instance/proxy.js' ,
23
+ 'src/sfc/deindent.js'
23
24
]
24
25
} ] ]
25
26
}
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ export default class Watcher {
27
27
deep : boolean ;
28
28
user : boolean ;
29
29
lazy : boolean ;
30
+ sync : boolean ;
30
31
dirty : boolean ;
31
32
active : boolean ;
32
33
deps : Array < Dep > ;
@@ -48,6 +49,7 @@ export default class Watcher {
48
49
this . deep = ! ! options . deep
49
50
this . user = ! ! options . user
50
51
this . lazy = ! ! options . lazy
52
+ this . sync = ! ! options . sync
51
53
this . expression = expOrFn . toString ( )
52
54
this . cb = cb
53
55
this . id = ++ uid // uid for batching
@@ -167,8 +169,11 @@ export default class Watcher {
167
169
* Will be called when a dependency changes.
168
170
*/
169
171
update ( ) {
172
+ /* istanbul ignore else */
170
173
if ( this . lazy ) {
171
174
this . dirty = true
175
+ } else if ( this . sync ) {
176
+ this . run ( )
172
177
} else {
173
178
queueWatcher ( this )
174
179
}
You can’t perform that action at this time.
0 commit comments