File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
src/core/instance/render-helpers
test/unit/features/directives Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 77 isObject ,
88 toObject ,
99 isReservedAttribute ,
10- camelize
10+ camelize ,
11+ hyphenate
1112} from 'core/util/index'
1213
1314/**
@@ -45,12 +46,13 @@ export function bindObjectProps (
4546 : data . attrs || ( data . attrs = { } )
4647 }
4748 const camelizedKey = camelize ( key )
48- if ( ! ( key in hash ) && ! ( camelizedKey in hash ) ) {
49+ const hyphenatedKey = hyphenate ( key )
50+ if ( ! ( camelizedKey in hash ) && ! ( hyphenatedKey in hash ) ) {
4951 hash [ key ] = value [ key ]
5052
5153 if ( isSync ) {
5254 const on = data . on || ( data . on = { } )
53- on [ `update:${ camelizedKey } ` ] = function ( $event ) {
55+ on [ `update:${ key } ` ] = function ( $event ) {
5456 value [ key ] = $event
5557 }
5658 }
Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ describe('Directive v-bind', () => {
234234 template : `<test v-bind="test" data-foo="foo" dataBar="bar"/>` ,
235235 components : {
236236 test : {
237- template : '<div :data-foo=" dataFoo" :data-bar=" dataBar"> </div>' ,
237+ template : '<div>{{ dataFoo }} {{ dataBar }} </div>' ,
238238 props : [ 'dataFoo' , 'dataBar' ]
239239 }
240240 } ,
@@ -245,8 +245,7 @@ describe('Directive v-bind', () => {
245245 }
246246 }
247247 } ) . $mount ( )
248- expect ( vm . $el . getAttribute ( 'data-foo' ) ) . toBe ( 'foo' )
249- expect ( vm . $el . getAttribute ( 'data-bar' ) ) . toBe ( 'bar' )
248+ expect ( vm . $el . textContent ) . toBe ( 'foo bar' )
250249 } )
251250
252251 it ( '.sync modifier with bind object' , done => {
You can’t perform that action at this time.
0 commit comments