以前使用面向对象编程,页面需要引入多个js,造成多个请求,影响加载,需要注意引用的顺序,使用时无法直接从js里看出文件的层级关系,一旦出错调试很麻烦 // /index.html <div id="root"></div> <script src="./header.js"></script> <script src="./index.js&q...
以前使用面向对象编程,页面需要引入多个js,造成多个请求,影响加载,需要注意引用的顺序,使用时无法直接从js里看出文件的层级关系,一旦出错调试很麻烦 // /index.html <div id="root"></div> <script src="./header.js"></script> <script src="./index.js&q...