Browse Source

fix raf bind in IE9

Evan You 9 năm trước cách đây
mục cha
commit
1ec501ebbf
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      src/platforms/web/runtime/transition-util.js

+ 4 - 1
src/platforms/web/runtime/transition-util.js

@@ -28,7 +28,10 @@ if (hasTransition) {
 }
 
 // binding to window is necessary to make hot reload work in IE in strict mode
-const raf = (inBrowser && window.requestAnimationFrame.bind(window)) || setTimeout
+const raf = inBrowser && window.requestAnimationFrame
+  ? window.requestAnimationFrame.bind(window)
+  : setTimeout
+
 export function nextFrame (fn: Function) {
   raf(() => {
     raf(fn)