{"size": 680, "ext": "js", "max_stars_repo_path": "dist/components/nwFileDialog/app.js", "max_stars_repo_name": "ZackLeonardo/nw-hexo-blog-client", "max_stars_repo_stars_event_min_datetime": "2017-12-18T17:55:57.000Z", "max_stars_repo_stars_event_max_datetime": "2017-12-18T17:55:57.000Z", "max_issues_repo_path": "dist/components/nwFileDialog/app.js", "max_issues_repo_name": "ZackLeonardo/nw-react-hexo-blog-client", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "dist/components/nwFileDialog/app.js", "max_forks_repo_name": "ZackLeonardo/nw-react-hexo-blog-client", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.2, "max_line_length": 137, "alphanum_fraction": 0.6897058824}
'use strict';

var React = require('react');
var ReactDOM = require('react-dom');

//定义React组件
var FolderSelector = React.createClass({
  displayName: 'FolderSelector',

  chooseFile: function chooseFile(name) {
    var chooser = document.querySelector(name);
    // chooser.addEventListener("change", function(evt) {
    console.log(this.value);
    // }, false);

    // chooser.click();
  },

  render: function render() {
    return React.createElement('input', { id: 'fileDialog', type: 'file', nwdirectory: true, onChange: this.chooseFile('#fileDialog') });
  }
});

//渲染
ReactDOM.render(React.createElement(FolderSelector, null), document.getElementById('folderSelector'));