File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
test/unit/specs/directives Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -1018,5 +1018,33 @@ if (_.inBrowser) {
1018
1018
} , 200 )
1019
1019
} )
1020
1020
1021
+ it ( 'update on bind value change' , function ( done ) {
1022
+ var vm = new Vue ( {
1023
+ el : el ,
1024
+ template :
1025
+ '<input type="radio" v-model="a" checked :value="b">' +
1026
+ '<input type="radio" v-model="a" :value="c">' ,
1027
+ data : {
1028
+ a : 0 ,
1029
+ b : 1 ,
1030
+ c : 2
1031
+ }
1032
+ } )
1033
+ // should sync inline-checked value to a
1034
+ expect ( vm . a ) . toBe ( 1 )
1035
+ vm . b = 3
1036
+ _ . nextTick ( function ( ) {
1037
+ expect ( vm . a ) . toBe ( 3 )
1038
+ expect ( el . firstChild . checked ) . toBe ( true )
1039
+ expect ( el . lastChild . checked ) . toBe ( false )
1040
+ vm . a = 2
1041
+ _ . nextTick ( function ( ) {
1042
+ expect ( el . firstChild . checked ) . toBe ( false )
1043
+ expect ( el . lastChild . checked ) . toBe ( true )
1044
+ done ( )
1045
+ } )
1046
+ } )
1047
+ } )
1048
+
1021
1049
} )
1022
1050
}
You can’t perform that action at this time.
0 commit comments