1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSPM Intro</title> <meta name="description" content="JSPM Intro"> <meta name="author" content="MTyson"> </head> <body> <script src="node_modules/jquery/dist/jquery.js"></script> <script src="app.js"></script> </body> </html> |
“您可以在 ES6 中编写 include 语句,以各种格式导入程序包,包括 AMD、CommonJS、ES6 和旧式全局封装。”
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSPM Intro</title> <meta name="description" content="JSPM Intro"> <meta name="author" content="MTyson"> <head> <script src="jspm_packages/system.js"></script> <script src="config.js"></script> <script> System.import('./app'); </script> </head> </head> <body> </body> </html> |
1 2 3 | import $ from 'jquery'; &("body").append("<div>Ground control to major Tom.</div>"); |
1 2 3 4 | import & from 'jquery'; export function init(){ &("body").append("<div>Good morning!.</div>"); &("body").append("<div>How are you?.</div>"); |
1 2 3 4 5 | <script> System.import('./app').then(function(app){ app.init(); }); </script> |
1 2 3 | div { background-color: red; } |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |