Explorar o código

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 %!s(int64=12) %!d(string=hai) anos
pai
achega
0f448b8678
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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) {