AMD模块&CommonJs模块&ES6模块
AMD模块:
define(function (require) {
//通过模块加载路径获得依赖模块
const bar = require('./bar');
//模块产出
return function () {
//............
};
})
CommomJS模块:
// 通过相对路径获得依赖模块
const bar = require ('./bar');
//模块产出
module.exports = function () {
//.........
};
ES6模块:
// 通过相对路径获得依赖模块
import bar from './bar';
//模块产出
export default function () {
//....
}

浙公网安备 33010602011771号