{"action":"created","issue":{"url":"https://api.github.com/repos/SunXinFei/sunxinfei.github.io/issues/1","repository_url":"https://api.github.com/repos/SunXinFei/sunxinfei.github.io","labels_url":"https://api.github.com/repos/SunXinFei/sunxinfei.github.io/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/SunXinFei/sunxinfei.github.io/issues/1/comments","events_url":"https://api.github.com/repos/SunXinFei/sunxinfei.github.io/issues/1/events","html_url":"https://github.com/SunXinFei/sunxinfei.github.io/issues/1","id":303707042,"node_id":"MDU6SXNzdWUzMDM3MDcwNDI=","number":1,"title":"Vue与React与ECMA6中的一些总结","user":{"login":"SunXinFei","id":5847281,"node_id":"MDQ6VXNlcjU4NDcyODE=","avatar_url":"https://avatars0.githubusercontent.com/u/5847281?v=4","gravatar_id":"","url":"https://api.github.com/users/SunXinFei","html_url":"https://github.com/SunXinFei","followers_url":"https://api.github.com/users/SunXinFei/followers","following_url":"https://api.github.com/users/SunXinFei/following{/other_user}","gists_url":"https://api.github.com/users/SunXinFei/gists{/gist_id}","starred_url":"https://api.github.com/users/SunXinFei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SunXinFei/subscriptions","organizations_url":"https://api.github.com/users/SunXinFei/orgs","repos_url":"https://api.github.com/users/SunXinFei/repos","events_url":"https://api.github.com/users/SunXinFei/events{/privacy}","received_events_url":"https://api.github.com/users/SunXinFei/received_events","type":"User","site_admin":false},"labels":[{"id":861099916,"node_id":"MDU6TGFiZWw4NjEwOTk5MTY=","url":"https://api.github.com/repos/SunXinFei/sunxinfei.github.io/labels/ECMA6","name":"ECMA6","color":"15870d","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-03-09T02:58:12Z","updated_at":"2018-09-25T02:36:28Z","closed_at":null,"author_association":"OWNER","body":""},"comment":{"url":"https://api.github.com/repos/SunXinFei/sunxinfei.github.io/issues/comments/424187990","html_url":"https://github.com/SunXinFei/sunxinfei.github.io/issues/1#issuecomment-424187990","issue_url":"https://api.github.com/repos/SunXinFei/sunxinfei.github.io/issues/1","id":424187990,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDE4Nzk5MA==","user":{"login":"SunXinFei","id":5847281,"node_id":"MDQ6VXNlcjU4NDcyODE=","avatar_url":"https://avatars0.githubusercontent.com/u/5847281?v=4","gravatar_id":"","url":"https://api.github.com/users/SunXinFei","html_url":"https://github.com/SunXinFei","followers_url":"https://api.github.com/users/SunXinFei/followers","following_url":"https://api.github.com/users/SunXinFei/following{/other_user}","gists_url":"https://api.github.com/users/SunXinFei/gists{/gist_id}","starred_url":"https://api.github.com/users/SunXinFei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SunXinFei/subscriptions","organizations_url":"https://api.github.com/users/SunXinFei/orgs","repos_url":"https://api.github.com/users/SunXinFei/repos","events_url":"https://api.github.com/users/SunXinFei/events{/privacy}","received_events_url":"https://api.github.com/users/SunXinFei/received_events","type":"User","site_admin":false},"created_at":"2018-09-25T02:36:28Z","updated_at":"2018-09-25T02:36:28Z","author_association":"OWNER","body":"## 关于React中的super参数props\r\n```js\r\nconstructor() {\r\n    super()\r\n    console.log(this.props)//undefined\r\n    console.log(props)//error\r\n}\r\nconstructor(props) {\r\n    super()\r\n    console.log(this.props)//undefined\r\n    console.log(props)//{ icon: 'home', … }\r\n }\r\n constructor(props) {\r\n    super(props)\r\n    console.log(this.props)//{ icon: 'home', … }\r\n    console.log(props)//{ icon: 'home', … }\r\n}\r\n```\r\n所以在子类组件的构造函数constructor和super中加入参数props，就是为了让子类可以访问this.props，\r\n[stackoverflow的回答](https://stackoverflow.com/questions/30571875/whats-the-difference-between-super-and-superprops-in-react-when-using-e/34995257#34995257)"}}
{"actor":{"display_login":"SunXinFei"}}