Can WeChat Mini Programs app.js quote the contents of other js files?

developed by WeChat Mini Programs

ask urgently whether the app.js file can refer to the contents of other js files, and how to quote it
Mar.28,2021

Yes, just require directly


you can first expose the method to be called in the js to be referenced. Put,get is the method name
module.exports = {
put: put,
get: get,
}
reference method
var cache = require ("path");
cache.put ();

Menu