Просмотр исходного кода

fix #580 parent scope directives compiled twice

Evan You 11 лет назад
Родитель
Сommit
e85319f15f
1 измененных файлов с 6 добавлено и 5 удалено
  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)