Explorar el Código

feat: support RegExp in ignoredElements (#6769)

Raymond Muller hace 8 años
padre
commit
795b908095
Se han modificado 1 ficheros con 8 adiciones y 1 borrados
  1. 8 1
      src/core/vdom/patch.js

+ 8 - 1
src/core/vdom/patch.js

@@ -120,7 +120,14 @@ export function createPatchFunction (backend) {
         if (
         if (
           !inPre &&
           !inPre &&
           !vnode.ns &&
           !vnode.ns &&
-          !(config.ignoredElements.length && config.ignoredElements.indexOf(tag) > -1) &&
+          !(
+            config.ignoredElements.length &&
+            config.ignoredElements.some(ignore => {
+              return ignore instanceof RegExp
+                ? ignore.test(tag)
+                : ignore === tag
+            })
+          ) &&
           config.isUnknownElement(tag)
           config.isUnknownElement(tag)
         ) {
         ) {
           warn(
           warn(