Răsfoiți Sursa

fix svg e2e

Evan You 10 ani în urmă
părinte
comite
32ca8e7722
2 a modificat fișierele cu 4 adăugiri și 4 ștergeri
  1. 1 1
      examples/svg/index.html
  2. 3 3
      src/runtime/instance/render.js

+ 1 - 1
examples/svg/index.html

@@ -38,7 +38,7 @@
         <label>{{stat.label}}</label>
         <input type="range" v-model="stat.value" min="0" max="100">
         <span>{{stat.value}}</span>
-        <button @click="remove(stat)">X</button>
+        <button @click="remove(stat)" class="remove">X</button>
       </div>
       <form id="add">
         <input name="newlabel" v-model="newLabel">

+ 3 - 3
src/runtime/instance/render.js

@@ -123,11 +123,11 @@ function resolveSlots (vm, children) {
   }
 }
 
+const keysToDiff = ['class', 'style', 'attrs', 'props', 'directives']
 function parentDataChanged (data, oldData) {
-  const keys = Object.keys(oldData)
   let key, old, cur, i, l, j, k
-  for (i = 0, l = keys.length; i < l; i++) {
-    key = keys[i]
+  for (i = 0, l = keysToDiff.length; i < l; i++) {
+    key = keysToDiff[i]
     cur = data[key]
     old = oldData[key]
     if (key === 'on') continue