初识seajs

seajs是对js的一种模块化管理的js库。

在页面中引入seajs即可使用。

使用步骤:

1、使用define将变成模块

define(function(require,exports,module){

  function drag(){

  }

  exports.drag = drag;

);

2、调用模块(exports提供对外的调用接口)

seajs.use('./module的路径',function(ex){

});

3、一个模块如何依赖另一个模块(require)

require('./module的路径')该方法返回的就是module中的exports对象

原文地址:https://www.cnblogs.com/toodeep/p/4576041.html