I have the main.js file in the parse cloud, where I import an util module
var util = require('cloud/util.js');
Now, I have another module, called user
var user = require('cloud/user.js');
The problem is that if I want to use the util var inside the user, it will say:
Failed with: ReferenceError: util is not defined
显然,require更像是一个导入,因此,如果您想在user.js文件中使用util,只需添加一个新的
var util = require('cloud/util.js');
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.