File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed
Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change 1- var _ = require ( '../util' )
21var Watcher = require ( '../watcher' )
32
43module . exports = {
@@ -16,25 +15,20 @@ module.exports = {
1615 // without this it would stabilize too, but this makes
1716 // sure it doesn't cause other watchers to re-evaluate.
1817 var locked = false
19- var lock = function ( ) {
20- locked = true
21- _ . nextTick ( unlock )
22- }
23- var unlock = function ( ) {
24- locked = false
25- }
2618
2719 if ( ! prop . oneWayUp ) {
2820 this . parentWatcher = new Watcher (
2921 parent ,
3022 parentKey ,
3123 function ( val ) {
3224 if ( ! locked ) {
33- lock ( )
25+ locked = true
3426 // all props have been initialized already
3527 child [ childKey ] = val
28+ locked = false
3629 }
37- }
30+ } ,
31+ { sync : true }
3832 )
3933
4034 // set the child initial value first, before setting
@@ -51,10 +45,12 @@ module.exports = {
5145 childKey ,
5246 function ( val ) {
5347 if ( ! locked ) {
54- lock ( )
48+ locked = true
5549 parent . $set ( parentKey , val )
50+ locked = false
5651 }
57- }
52+ } ,
53+ { sync : true }
5854 )
5955
6056 // set initial value for one-way up binding
You can’t perform that action at this time.
0 commit comments