Ver Fonte

do not warn vue-loader scoped css attributes

Evan You há 10 anos atrás
pai
commit
abc9a238f4
1 ficheiros alterados com 17 adições e 11 exclusões
  1. 17 11
      src/compiler/compile.js

+ 17 - 11
src/compiler/compile.js

@@ -211,17 +211,23 @@ exports.compileRoot = function (el, options, contextOptions) {
     }
   } else if (process.env.NODE_ENV !== 'production' && containerAttrs) {
     // warn container directives for fragment instances
-    var names = containerAttrs.map(function (attr) {
-      return '"' + attr.name + '"'
-    }).join(', ')
-    var plural = containerAttrs.length > 1
-    _.warn(
-      'Attribute' + (plural ? 's ' : ' ') + names +
-      (plural ? ' are' : ' is') + ' ignored on component ' +
-      '<' + options.el.tagName.toLowerCase() + '> because ' +
-      'the component is a fragment instance: ' +
-      'http://vuejs.org/guide/components.html#Fragment_Instance'
-    )
+    var names = containerAttrs
+      .filter(function (attr) {
+        return attr.name.indexOf('_v-') < 0
+      })
+      .map(function (attr) {
+        return '"' + attr.name + '"'
+      })
+    if (names.length) {
+      var plural = names.length > 1
+      _.warn(
+        'Attribute' + (plural ? 's ' : ' ') + names.join(',') +
+        (plural ? ' are' : ' is') + ' ignored on component ' +
+        '<' + options.el.tagName.toLowerCase() + '> because ' +
+        'the component is a fragment instance: ' +
+        'http://vuejs.org/guide/components.html#Fragment_Instance'
+      )
+    }
   }
 
   return function rootLinkFn (vm, el, scope) {