Procházet zdrojové kódy

should remove partial attribute

Evan You před 12 roky
rodič
revize
a10fdbd920
1 změnil soubory, kde provedl 1 přidání a 2 odebrání
  1. 1 2
      src/compiler.js

+ 1 - 2
src/compiler.js

@@ -192,7 +192,6 @@ CompilerProto.compile = function (node, root) {
             }
             }
 
 
         } else if (vmExp && !root) { // nested ViewModels
         } else if (vmExp && !root) { // nested ViewModels
-
             node.removeAttribute(vmAttr)
             node.removeAttribute(vmAttr)
             var ChildVM = (opts.vms && opts.vms[vmExp]) || utils.vms[vmExp]
             var ChildVM = (opts.vms && opts.vms[vmExp]) || utils.vms[vmExp]
             if (ChildVM) {
             if (ChildVM) {
@@ -208,6 +207,7 @@ CompilerProto.compile = function (node, root) {
         } else { // normal node
         } else { // normal node
 
 
             if (partialExp) { // set partial
             if (partialExp) { // set partial
+                node.removeAttribute(partialAttr)
                 var partial =
                 var partial =
                     (opts.partials && opts.partials[partialExp]) ||
                     (opts.partials && opts.partials[partialExp]) ||
                     utils.partials[partialExp]
                     utils.partials[partialExp]
@@ -235,7 +235,6 @@ CompilerProto.compileNode = function (node) {
         i = attrs.length
         i = attrs.length
         while (i--) {
         while (i--) {
             attr = attrs[i]
             attr = attrs[i]
-            if (attr.name === vmAttr) continue
             valid = false
             valid = false
             exps = attr.value.split(',')
             exps = attr.value.split(',')
             j = exps.length
             j = exps.length