{"action":"opened","issue":{"url":"https://api.github.com/repos/hdmy/blog/issues/53","repository_url":"https://api.github.com/repos/hdmy/blog","labels_url":"https://api.github.com/repos/hdmy/blog/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/hdmy/blog/issues/53/comments","events_url":"https://api.github.com/repos/hdmy/blog/issues/53/events","html_url":"https://github.com/hdmy/blog/issues/53","id":369012978,"node_id":"MDU6SXNzdWUzNjkwMTI5Nzg=","number":53,"title":"ES6 modules / AMD / CommonJS","user":{"login":"hdmy","id":20206052,"node_id":"MDQ6VXNlcjIwMjA2MDUy","avatar_url":"https://avatars2.githubusercontent.com/u/20206052?v=4","gravatar_id":"","url":"https://api.github.com/users/hdmy","html_url":"https://github.com/hdmy","followers_url":"https://api.github.com/users/hdmy/followers","following_url":"https://api.github.com/users/hdmy/following{/other_user}","gists_url":"https://api.github.com/users/hdmy/gists{/gist_id}","starred_url":"https://api.github.com/users/hdmy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdmy/subscriptions","organizations_url":"https://api.github.com/users/hdmy/orgs","repos_url":"https://api.github.com/users/hdmy/repos","events_url":"https://api.github.com/users/hdmy/events{/privacy}","received_events_url":"https://api.github.com/users/hdmy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-11T08:42:46Z","updated_at":"2018-10-11T08:42:46Z","closed_at":null,"author_association":"OWNER","body":"### ES6 modules （vue中常见）\r\n通过 export 模块命名空间对象（又称模块对象），保存对方法的引用\r\n```javascript\r\n/* 分步导出，最终是一个 { foo, bar, ... } */\r\nexport function foo(canvas, options) {\r\n  //可以导出function\r\n}\r\nexport class bar {\r\n  //可以导出class\r\n}\r\n/*  或 一步导出 */\r\nexport default {foo,bar} \r\n\r\n/* 引用 */\r\nimport obj form xxx;\r\nimport {foo} form xxx;\r\n// 导入\"xxx\"并将它导出的内容的一部分重新导出 —— 聚合模块\r\nexport {xx} from \"xxx\";\r\n```"}}
{"actor":{"display_login":"hdmy"}}