uniapp出现ReferenceError: Can't find variable: xxx __ERROR

当你想在页面的onLoad方法你调用其他方法时

onLoad() {
xxx()
},

出现

[Vue warn]: Error in onLoad hook: "ReferenceError: Can't find variable: xxx" (found at pages/index/index.vue:1) __ERROR ReferenceError: Can't find variable: xxx __ERROR

改成

onLoad() {
this.xxx()
},

你可能感兴趣的:(uniapp出现ReferenceError: Can't find variable: xxx __ERROR)