Blogger Information
Blog 25
fans 0
comment 0
visits 42064
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
async在小程序中使用
程先生的博客
Original
876 people have browsed it

新版本的小程序支持async / await。勾选下面选项后重新编译程序即可

2019080310394142.png

如果小程序开发工具版本不支持,试试下面方法

1.在新建的文件夹中执行 npm init ,生成package.json文件(一路回车就好)

2.执行 npm install regenerator@0.13.1

3.将node_modules/regenerator-runtime/runtime.js复制到小程序项目中

4.在需要使用到async await的.js文件中引入runtime.js

import regeneratorRuntime from '../../utils/runtime.js'


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post