|
|
@@ -20,11 +20,8 @@ var modelProps = {
|
|
|
'false-value': '_falseValue'
|
|
|
}
|
|
|
|
|
|
-// regex to test for globally allowed attributes.
|
|
|
-// we only need to include ones that:
|
|
|
-// - do not have a corresponding property, e.g. role, dropzone;
|
|
|
-// - cannot be camelized into the corresponding property, .e.g class, accesskey, contenteditable;
|
|
|
-var globalAllowedAttrRE = /^(class|role|accesskey|contenteditable|contextmenu|dropzone|hidden|tabindex)$|^data-|^aria-/
|
|
|
+// check for attribtues that prohibit interpolations
|
|
|
+var disallowedInterpAttrRE = /^v-|^(is|transition|transition-mode|debounce|track-by|stagger|enter-stagger|leave-stagger)$/
|
|
|
|
|
|
module.exports = {
|
|
|
|
|
|
@@ -35,21 +32,11 @@ module.exports = {
|
|
|
// handle interpolation bindings
|
|
|
if (this.descriptor.interp) {
|
|
|
// only allow binding on native attributes
|
|
|
- if (!(
|
|
|
- // globally allowed attributes
|
|
|
- globalAllowedAttrRE.test(attr) ||
|
|
|
- // check if "for" is available on current element.
|
|
|
- // the corresponding property is a special case.
|
|
|
- (attr === 'for' && 'htmlFor' in this.el) ||
|
|
|
- // other attributes: check if a camelized property
|
|
|
- // is available on the element
|
|
|
- _.camelize(attr) in this.el
|
|
|
- )) {
|
|
|
+ if (disallowedInterpAttrRE.test(attr)) {
|
|
|
process.env.NODE_ENV !== 'production' && _.warn(
|
|
|
attr + '="' + this.descriptor.raw + '": ' +
|
|
|
- 'attribute interpolation is allowed only ' +
|
|
|
- 'in valid native attributes. "' + attr + '" ' +
|
|
|
- 'is not a valid attribute on <' + this.el.tagName.toLowerCase() + '>.'
|
|
|
+ 'attribute interpolation is not allowed in Vue.js ' +
|
|
|
+ 'directives and special attributes.'
|
|
|
)
|
|
|
this.el.removeAttribute(attr)
|
|
|
this.invalid = true
|