Sfoglia il codice sorgente

only check keep-alive on dynamic components

Evan You 10 anni fa
parent
commit
ef923be57b
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 3 3
      src/compiler/parser/index.js

+ 3 - 3
src/compiler/parser/index.js

@@ -326,9 +326,9 @@ function processComponent (el) {
   let binding
   if ((binding = getBindingAttr(el, 'is'))) {
     el.component = binding
-  }
-  if (getAndRemoveAttr(el, 'keep-alive') != null) {
-    el.keepAlive = true
+    if (getAndRemoveAttr(el, 'keep-alive') != null) {
+      el.keepAlive = true
+    }
   }
   if (getAndRemoveAttr(el, 'inline-template') != null) {
     el.inlineTemplate = true