uni-app---js暴露对象和引用module.exports---require

commom/utils.js

//暴露对象
const version = "1.0.0"

function getVersion() {
	return "getVersion:1.0.0"
}
module.exports = {
	version,
	getVersion
}
//js对象引入
let {version,getVersion} = require("../../common/utils.js");
console.log(version);
				debugger

你可能感兴趣的:(uni-app,javascript,前端,vue.js)