@@ -20,11 +20,8 @@ var modelProps = {
2020 'false-value' : '_falseValue'
2121}
2222
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 ) $ /
2825
2926module . exports = {
3027
@@ -35,21 +32,11 @@ module.exports = {
3532 // handle interpolation bindings
3633 if ( this . descriptor . interp ) {
3734 // 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 ) ) {
4836 process . env . NODE_ENV !== 'production' && _ . warn (
4937 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.'
5340 )
5441 this . el . removeAttribute ( attr )
5542 this . invalid = true
0 commit comments