前端模块化?

1.首先下载require.js引入在页面中,在引入require(['模块名']);

2.定义的模块间文件中用define(['jquery','template'],function($,template){...})

3.在1中引入的模块名最好在config.js中配置短名字:

   基础路径配置

  path:[

  jquery:"js/jquery"...

  ]

猜你喜欢

转载自www.cnblogs.com/duanzhange/p/9437015.html