Press "Enter" to skip to content

微信PC客户端不支持object.assign方法

Recently, I encountered a bug: my frontend project can work normally in WeChat mobile clients but when visited in WeChat PC client for window OS, the page turned out be be blank -_-. After some attempts, I found that it’s due to the unavailability of Object.assign method in WeChat PC client for window OS.

Therefore, we need to write polyfill for Object.assign method. There is not need to think how to write this polyfill ourselves. Just copy from MDN ^_^.

The code is from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign

Yakima Teng,

August 28, 2017

In Shanghai, China

Be First to Comment

发表评论