微信小程序框架接口模块化— Object exports

微信小程序框架接口模块化— Object exports

# Object exports

module.exports 的引用

# 示例代码

// common.js
function sayHello(name) {
  console.log(`Hello ${name} !`)
}
function sayGoodbye(name) {
  console.log(`Goodbye ${name} !`)
}

module.exports.sayHello = sayHello
exports.sayGoodbye = sayGoodbye