app.js 583 B

123456789101112131415161718192021222324252627
  1. /**
  2. * Created by Ryn on 2016/8/7.
  3. * 入口文件
  4. */
  5. import '../style/style.css';
  6. import React from 'react';
  7. import ReactDOM from 'react-dom';
  8. import Calendar from '../components/Calendar';
  9. const App = React.createClass({
  10. selectDate(year, month, day) {
  11. alert("当前日期为:" + year + '年' + month + '月' + day + '日' );
  12. },
  13. render() {
  14. return (
  15. <Calendar onSelectDate={this.selectDate} year="2016" month="8" day="7" tags={[5, 21]} />
  16. );
  17. }
  18. });
  19. ReactDOM.render(
  20. <App />,
  21. document.getElementById('datePicker')
  22. );