微信小程序 - wepy问题集(实时更新)
2021-09-22 本文已影响0人
刘_小_二
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},