File tree Expand file tree Collapse file tree 1 file changed +21
-5
lines changed Expand file tree Collapse file tree 1 file changed +21
-5
lines changed Original file line number Diff line number Diff line change 2
2
extend ,
3
3
isArray ,
4
4
hyphenate ,
5
- camelize
5
+ camelize ,
6
+ warn
6
7
} from '../../util/index'
7
8
8
9
const prefixes = [ '-webkit-' , '-moz-' , '-ms-' ]
@@ -56,11 +57,20 @@ export default {
56
57
? 'important'
57
58
: ''
58
59
if ( isImportant ) {
60
+ /* istanbul ignore if */
61
+ if ( process . env . NODE_ENV !== 'production' ) {
62
+ warn (
63
+ 'It\'s probably a bad idea to use !important with inline rules. ' +
64
+ 'This feature will be deprecated in a future version of Vue.'
65
+ )
66
+ }
59
67
value = value . replace ( importantRE , '' ) . trim ( )
68
+ this . el . style . setProperty ( prop . kebab , value , isImportant )
69
+ } else {
70
+ this . el . style [ prop . camel ] = value
60
71
}
61
- this . el . style . setProperty ( prop , value , isImportant )
62
72
} else {
63
- this . el . style . removeProperty ( prop )
73
+ this . el . style [ prop . camel ] = ''
64
74
}
65
75
}
66
76
@@ -105,10 +115,16 @@ function prefix (prop) {
105
115
while ( i -- ) {
106
116
prefixed = camelPrefixes [ i ] + upper
107
117
if ( prefixed in testEl . style ) {
108
- return prefixes [ i ] + prop
118
+ return {
119
+ kebab : prefixes [ i ] + prop ,
120
+ camel : prefixed
121
+ }
109
122
}
110
123
}
111
124
if ( camel in testEl . style ) {
112
- return prop
125
+ return {
126
+ kebab : prop ,
127
+ camel : camel
128
+ }
113
129
}
114
130
}
You can’t perform that action at this time.
0 commit comments