微信小程序运行在三端:iOS、Android 和 用于调试的开发者工具。
三端的脚本执行环境聚以及用于渲染非原生组件的环境是各不相同的:
尽管三端的环境是十分相似的,但是还是有些许区别:
ES6语法支持不一致,语法上开发者可以通过开启ES6转ES5的功能来规避。详情
wxss渲染表现不一致,尽管可以通过开启样式补全来规避大部分的问题 详情,还是建议开发者需要在 iOS 和 Android 上检查小程序的真实表现。
开发者使用手机扫码调试的场景下,打开调试模式之后,最新版的客户端将不检查可信域名。
iOS下仅支持 UTF8 编码格式,最新版本的开发者工具会在上传代码时候对代码文件做一次编码格式校验。
微信小程序已经支持了绝大部分的 ES6 API 具体表格如下:
tip: TBS 3.0 是指微信小程序 Android 运行环境tip: Array.values不支持tip: Proxy不支持| String | iOS8 | iOS9 | iOS10 | TBS3.0 |
|---|---|---|---|---|
| codePointAt | ||||
| normalize | ||||
| includes | ||||
| startsWith | ||||
| endsWith | ||||
| repeat | ||||
| String.fromCodePoint |
| Array | iOS8 | iOS9 | iOS10 | TBS3.0 |
|---|---|---|---|---|
| copyWithin | ||||
| find | ||||
| findIndex | ||||
| fill | ||||
| entries | ||||
| keys | ||||
| values | ✘ | ✘ | ||
| includes | ||||
| Array.from | ||||
| Array.of |
| Number | iOS8 | iOS9 | iOS10 | TBS3.0 |
|---|---|---|---|---|
| isFinite | ||||
| isNaN | ||||
| parseInt | ||||
| parseFloat | ||||
| isInteger | ||||
| EPSILON | ||||
| isSafeInteger |
| Math | iOS8 | iOS9 | iOS10 | TBS3.0 |
|---|---|---|---|---|
| trunc | ||||
| sign | ||||
| cbrt | ||||
| clz32 | ||||
| imul | ||||
| fround | ||||
| hypot | ||||
| expm1 | ||||
| log1p | ||||
| log10 | ||||
| log2 | ||||
| sinh | ||||
| cosh | ||||
| tanh | ||||
| asinh | ||||
| acosh | ||||
| atanh |
| Object | iOS8 | iOS9 | iOS10 | TBS3.0 |
|---|---|---|---|---|
| is | ||||
| assign | ||||
| getOwnPropertyDescriptor | ||||
| keys | ||||
| getOwnPropertyNames | ||||
| getOwnPropertySymbols |
| Other | iOS8 | iOS9 | iOS10 | TBS3.0 | |
|---|---|---|---|---|---|
| Symbol | |||||
| Set | |||||
| Map | |||||
| Proxy | ✘ | ✘ | ✘ | ||
| Reflect | |||||
| Promise |
备案信息: 粤ICP备15087711号-2
Copyright © 2008-2025 啊嘎哇在线工具箱 All Rights.
本站所有资料来源于网络,版权归原作者所有,仅作学习交流使用,如不慎侵犯了您的权利,请联系我们。