Skip to content

Commit ef2b124

Browse files
committed
fix: child data cannot sync to parent in some case, closes #235
1 parent 3bbc847 commit ef2b124

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

dist/regular.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ return /******/ (function(modules) { // webpackBootstrap
880880
}
881881
return paramObj;
882882
}
883-
_.eventReg = /^on-(\w[-\w]+)$/;
883+
_.eventReg = /^on-(\w[-\w]*)$/;
884884

885885
_.toText = function(obj){
886886
return obj == null ? "": "" + obj;
@@ -4906,12 +4906,16 @@ return /******/ (function(modules) { // webpackBootstrap
49064906
value = self._touchExpr(value);
49074907
// use bit operate to control scope
49084908
if( !(isolate & 2) )
4909+
// sync data from parent to child
49094910
this.$watch(value, (function(name, val){
49104911
this.data[name] = val;
49114912
}).bind(component, name), OPTIONS.SYNC)
49124913
if( value.set && !(isolate & 1 ) )
4913-
// sync the data. it force the component don't trigger attr.name's first dirty echeck
4914-
component.$watch(name, self.$update.bind(self, value), OPTIONS.INIT);
4914+
// sync data from child to parent. it force the component don't trigger attr.name's first dirty echeck
4915+
component.$watch(name, self.$update.bind(self, value), {
4916+
init: true,
4917+
last: this.data[ name ]
4918+
});
49154919
}
49164920
}
49174921
if(is && is.type === 'expression' ){

0 commit comments

Comments
 (0)