Prechádzať zdrojové kódy

component: exclude <time> and others from custom element list

Evan You 10 rokov pred
rodič
commit
13e033551a
1 zmenil súbory, kde vykonal 9 pridanie a 2 odobranie
  1. 9 2
      src/util/component.js

+ 9 - 2
src/util/component.js

@@ -21,8 +21,15 @@ exports.checkComponent = function (el, options) {
       if (is) {
         return is
       } else if (process.env.NODE_ENV !== 'production') {
-        if (tag.indexOf('-') > -1 ||
-            /HTMLUnknownElement/.test(Object.prototype.toString.call(el))) {
+        if (
+          tag.indexOf('-') > -1 ||
+          (
+            /HTMLUnknownElement/.test(el.toString()) &&
+            // Chrome returns unknown for several HTML5 elements.
+            // https://code.google.com/p/chromium/issues/detail?id=540526
+            !/^(data|time|rtc|rb)$/.test(tag)
+          )
+        ) {
           _.warn(
             'Unknown custom element: <' + tag + '> - did you ' +
             'register the component correctly?'