微信小程序 - wepy问题集(实时更新)

416 阅读1分钟

1.0 wepy.js微信小程序报错'wx' is not defined no-undef

【说明】该错误是eslint报错吧。禁用eslint或者给eslint加上全局变量wx

【解决方法】在.eslintrc.js文件中加入以下内容;

globals: { wx: true},

1.1wepy开发小程序eslint报错error 'getApp' is not defined no-undef

【说明】该错误是eslint报错吧。禁用eslint或者给eslint加上全局变量getApp

【解决方法】在.eslintrc.js文件中加入以下内容;

globals: { getApp: true},

// all
globals: { getApp: true, wx: true},