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

Fix IE directive not compiled issue

In the TodoMVC example, when `v-show` is compiled first, it adds an
inline style attribute to the node. Since IE seems to handle the order
of attributes in `node.attributes` differently from other browsers,
this causes some directives to be skipped and never compiled. Simply
copy the attribtues into an Array before compiling solves the issue.
Evan You 12 лет назад
Родитель
Сommit
0f448b8678
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/compiler.js

+ 1 - 1
src/compiler.js

@@ -326,7 +326,7 @@ CompilerProto.compile = function (node, root) {
  */
 CompilerProto.compileNode = function (node) {
     var i, j,
-        attrs = node.attributes,
+        attrs = slice.call(node.attributes),
         prefix = config.prefix + '-'
     // parse if has attributes
     if (attrs && attrs.length) {