Explorar o código

fix #580 parent scope directives compiled twice

Evan You %!s(int64=11) %!d(string=hai) anos
pai
achega
e85319f15f
Modificáronse 1 ficheiros con 6 adicións e 5 borrados
  1. 6 5
      src/compile/compile.js

+ 6 - 5
src/compile/compile.js

@@ -468,11 +468,12 @@ function collectDirectives (el, options, asParent) {
     attrName = attr.name
     if (attrName.indexOf(config.prefix) === 0) {
       dirName = attrName.slice(config.prefix.length)
-      if (
-        asParent &&
-        (dirName === 'with' || dirName === 'ref')
-      ) {
-        continue
+      if (asParent) {
+        if (dirName === 'with' || dirName === 'ref') {
+          continue
+        } else {
+          el.removeAttribute(attrName)
+        }
       }
       dirDef = options.directives[dirName]
       _.assertAsset(dirDef, 'directive', dirName)