File tree 2 files changed +6
-1
lines changed
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ function a() {
13
13
<component visible$sync={this.test[1]}>I am newbie</component>
14
14
<component visible$sync={this.test.a}>I am newbie</component>
15
15
<component visible$sync={false}>I am newbie</component>
16
+ <component visible-leon$sync={this.test}>I am newbie</component>
16
17
</div>
17
18
)
18
19
}`
Original file line number Diff line number Diff line change 1
1
let syncRe = / ( .* ) \$ s y n c /
2
+ const camelizeRE = / - ( \w ) / g;
3
+ const camelize = ( str ) => {
4
+ return str . replace ( camelizeRE , ( _ , c ) => c ? c . toUpperCase ( ) : '' )
5
+ }
2
6
3
7
var genListener = function genListener ( t , event , body ) {
4
8
return t . jSXAttribute (
@@ -38,7 +42,7 @@ module.exports = function(babel) {
38
42
return
39
43
}
40
44
41
- let listener = genListener ( t , 'Update:' + prop ,
45
+ let listener = genListener ( t , 'Update:' + camelize ( prop ) ,
42
46
[ genAssignmentCode ( t , model ) ] )
43
47
attr . insertAfter ( listener )
44
48
}
You can’t perform that action at this time.
0 commit comments