@@ -20,11 +20,8 @@ var modelProps = {
20
20
'false-value' : '_falseValue'
21
21
}
22
22
23
- // regex to test for globally allowed attributes.
24
- // we only need to include ones that:
25
- // - do not have a corresponding property, e.g. role, dropzone;
26
- // - cannot be camelized into the corresponding property, .e.g class, accesskey, contenteditable;
27
- var globalAllowedAttrRE = / ^ ( c l a s s | r o l e | a c c e s s k e y | c o n t e n t e d i t a b l e | c o n t e x t m e n u | d r o p z o n e | h i d d e n | t a b i n d e x ) $ | ^ d a t a - | ^ a r i a - /
23
+ // check for attribtues that prohibit interpolations
24
+ var disallowedInterpAttrRE = / ^ v - | ^ ( i s | t r a n s i t i o n | t r a n s i t i o n - m o d e | d e b o u n c e | t r a c k - b y | s t a g g e r | e n t e r - s t a g g e r | l e a v e - s t a g g e r ) $ /
28
25
29
26
module . exports = {
30
27
@@ -35,21 +32,11 @@ module.exports = {
35
32
// handle interpolation bindings
36
33
if ( this . descriptor . interp ) {
37
34
// only allow binding on native attributes
38
- if ( ! (
39
- // globally allowed attributes
40
- globalAllowedAttrRE . test ( attr ) ||
41
- // check if "for" is available on current element.
42
- // the corresponding property is a special case.
43
- ( attr === 'for' && 'htmlFor' in this . el ) ||
44
- // other attributes: check if a camelized property
45
- // is available on the element
46
- _ . camelize ( attr ) in this . el
47
- ) ) {
35
+ if ( disallowedInterpAttrRE . test ( attr ) ) {
48
36
process . env . NODE_ENV !== 'production' && _ . warn (
49
37
attr + '="' + this . descriptor . raw + '": ' +
50
- 'attribute interpolation is allowed only ' +
51
- 'in valid native attributes. "' + attr + '" ' +
52
- 'is not a valid attribute on <' + this . el . tagName . toLowerCase ( ) + '>.'
38
+ 'attribute interpolation is not allowed in Vue.js ' +
39
+ 'directives and special attributes.'
53
40
)
54
41
this . el . removeAttribute ( attr )
55
42
this . invalid = true
0 commit comments