فهرست منبع

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 سال پیش
والد
کامیت
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) {