小程序
小游戏
企业微信
微信支付
扫描小程序码分享
问题一:请问如何把公共方法挂载到全局?
例如写了个navigateTo的方法
app.navigateTo
app.globalData.navigateTo
哪个好?
问题二:开启es6转es5报错了,如果我已经使用webpack编译代码,是否还需要开启?
1 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
1.第一个好
2.发一下代码看看
如果觉得有帮助,请点个「有用」。千山万水总是情,别问「尾巴」行不行
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
try {
regeneratorRuntime = runtime;
} catch (accidentalStrictMode) {
// This module should not be running in strict mode, so the above
// assignment should always work unless something is misconfigured. Just
// in case runtime.js accidentally runs in strict mode, we can escape
// strict mode using a global Function call. This could conceivably fail
// if a Content Security Policy forbids using Function, but in that case
// the proper solution is to fix the accidental strict mode problem. If
// you've misconfigured your bundler to force strict mode and applied a
// CSP to forbid Function, and you're not willing to fix either of those
// problems, please detail your unique predicament in a GitHub issue.
Function("r", "regeneratorRuntime = r")(runtime);
}
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
1.第一个好
2.发一下代码看看
如果觉得有帮助,请点个「有用」。千山万水总是情,别问「尾巴」行不行
try {
regeneratorRuntime = runtime;
} catch (accidentalStrictMode) {
// This module should not be running in strict mode, so the above
// assignment should always work unless something is misconfigured. Just
// in case runtime.js accidentally runs in strict mode, we can escape
// strict mode using a global Function call. This could conceivably fail
// if a Content Security Policy forbids using Function, but in that case
// the proper solution is to fix the accidental strict mode problem. If
// you've misconfigured your bundler to force strict mode and applied a
// CSP to forbid Function, and you're not willing to fix either of those
// problems, please detail your unique predicament in a GitHub issue.
Function("r", "regeneratorRuntime = r")(runtime);
}
如果觉得有帮助,请点个「有用」。千山万水总是情,别问「尾巴」行不行
如果觉得有帮助,请点个「有用」。千山万水总是情,别问「尾巴」行不行