1. First create the common.js file
function myfunc(){
console.log('hhhhh')
}
module.exports.myfunc = myfunc; //将函数导出来
2. Introduce in your own js file
var common = require("./common.js");
Page({
data:{
},
calPages(){
var sourcePath = this.data.sourcePath
common.myfunc()
}
})