File tree 2 files changed +16
-2
lines changed
test/unit/specs/directives/public
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'
2
2
import { BIND } from '../priorities'
3
3
import vStyle from '../internal/style'
4
4
import { tokensToExp } from '../../parsers/text'
@@ -96,6 +96,9 @@ export default {
96
96
handleSingle ( attr , value ) {
97
97
const el = this . el
98
98
const interp = this . descriptor . interp
99
+ if ( this . modifiers . camel ) {
100
+ attr = camelize ( attr )
101
+ }
99
102
if (
100
103
! interp &&
101
104
attrWithPropsRE . test ( attr ) &&
Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ describe('v-bind', function () {
9
9
el = document . createElement ( 'div' )
10
10
dir = {
11
11
el : el ,
12
- descriptor : { }
12
+ descriptor : { } ,
13
+ modifiers : { }
13
14
}
14
15
_ . extend ( dir , def )
15
16
} )
@@ -70,4 +71,14 @@ describe('v-bind', function () {
70
71
dir . update ( null )
71
72
expect ( dir . el . hasAttributeNS ( xlinkNS , 'special' ) ) . toBe ( false )
72
73
} )
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
+ } )
73
84
} )
You can’t perform that action at this time.
0 commit comments