Evan You 10 лет назад
Родитель
Сommit
f63618eeb2
1 измененных файлов с 9 добавлено и 0 удалено
  1. 9 0
      src/compiler/compile.js

+ 9 - 0
src/compiler/compile.js

@@ -9,6 +9,7 @@ var resolveAsset = _.resolveAsset
 var componentDef = require('../directives/component')
 
 // special binding prefixes
+var propRE = /^prop-/
 var bindRE = /^bind-/
 var onRE = /^on-/
 
@@ -584,6 +585,14 @@ function compileDirectives (attrs, options) {
       })
     } else
 
+    // should not see props here
+    if (process.env.NODE_ENV !== 'production' && propRE.test(name)) {
+      _.warn(
+        name + '="' + value + '" is not compiled. It\'s either not declared ' +
+        'on the child component, or it\'s used on a non-component element.'
+      )
+    } else
+
     // TODO: remove this in 1.0.0
     if (config.interpolate) {
       dir = collectAttrDirective(name, value, options)