You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.4 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

关于polyfill目录

用于抹平各平台差异化使小程序转换uniapp项目后能尽可能的少报错尽可能的先运行起来。

文件结构

base64Binary.js

用于 base64ToArrayBuffer, arrayBufferToBase64 两个函数的polyfill因为这两函数仅app与微信小程序支持特意制作此polyfill。

主要用于polyfill.js文件。

mixins.js

有两个用途: 一是在使用富文本时可以将后台传入的富文本字符串里面的转义符转换为普通字符与mp-html插件配合使用。 二是this.setData()函数的polyfill使转换后的uniapp项目可以直接使用setData函数。

polyfill.js

此文件对大量api进行判断如果在当前平台不支持此函数将会创建一个空函数并输出一条提示提示开发者这个api需针对性的进行兼容处理。

如果不处理的话,会直接进行报错,并影响流程的运行,对转换者的心理有一定的影响。

因此制作此polyfill让项目能先运行起来~

注意

如果觉得这些文件不需要想删除它,请一定要先阅读关于每个文件的说明,明白它的作用,再进行删除,以免项目运行报错,感谢合作~

如有不明白的地方,请联系作者(375890534@qq.com)或qq群(780359397、361784059、603659851)进行交流~

zhangdaren 2021-07-21