如何通过requireJs实现复杂的前端模块化开发?

2026-04-06 12:110阅读0评论SEO教程
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计74个文字,预计阅读时间需要1分钟。

如何通过requireJs实现复杂的前端模块化开发?

javascriptrequire.config({ paths: { jquery: 'http://libs.baidu.com/jquery/2.0.3/jquery' }});

require(['jquery', 'yl'], function($, a) { console.log(aa); var hel=new a.Hello(); alert(1); $(#output).text(Hello, World!);});

gistfile1.txt

require.config({ paths:{ jquery: 'libs.baidu.com/jquery/2.0.3/jquery' } }); require(['jquery','yl'],function ($,a) { console.log("aa"); var hel = new a.Hello(); alert("1"); $("#btn").click(function () { console.log(hel.name); }); });

如何通过requireJs实现复杂的前端模块化开发?

本文共计74个文字,预计阅读时间需要1分钟。

如何通过requireJs实现复杂的前端模块化开发?

javascriptrequire.config({ paths: { jquery: 'http://libs.baidu.com/jquery/2.0.3/jquery' }});

require(['jquery', 'yl'], function($, a) { console.log(aa); var hel=new a.Hello(); alert(1); $(#output).text(Hello, World!);});

gistfile1.txt

require.config({ paths:{ jquery: 'libs.baidu.com/jquery/2.0.3/jquery' } }); require(['jquery','yl'],function ($,a) { console.log("aa"); var hel = new a.Hello(); alert("1"); $("#btn").click(function () { console.log(hel.name); }); });

如何通过requireJs实现复杂的前端模块化开发?