File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
test/unit/specs/directives/public Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1- import { warn , setClass } from '../../util/index'
1+ import { warn , setClass , camelize } from '../../util/index'
22import { BIND } from '../priorities'
33import vStyle from '../internal/style'
44import { tokensToExp } from '../../parsers/text'
@@ -96,6 +96,9 @@ export default {
9696 handleSingle ( attr , value ) {
9797 const el = this . el
9898 const interp = this . descriptor . interp
99+ if ( this . modifiers . camel ) {
100+ attr = camelize ( attr )
101+ }
99102 if (
100103 ! interp &&
101104 attrWithPropsRE . test ( attr ) &&
Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ describe('v-bind', function () {
99 el = document . createElement ( 'div' )
1010 dir = {
1111 el : el ,
12- descriptor : { }
12+ descriptor : { } ,
13+ modifiers : { }
1314 }
1415 _ . extend ( dir , def )
1516 } )
@@ -70,4 +71,14 @@ describe('v-bind', function () {
7071 dir . update ( null )
7172 expect ( dir . el . hasAttributeNS ( xlinkNS , 'special' ) ) . toBe ( false )
7273 } )
74+
75+ it ( 'camel modifier' , function ( ) {
76+ dir . modifiers . camel = true
77+ var div = document . createElement ( 'div' )
78+ div . innerHTML = '<svg></svg>'
79+ dir . el = div . children [ 0 ]
80+ dir . arg = 'view-box'
81+ dir . update ( '0 0 1500 1000' )
82+ expect ( dir . el . getAttribute ( 'viewBox' ) ) . toBe ( '0 0 1500 1000' )
83+ } )
7384} )
You can’t perform that action at this time.
0 commit comments