/** * Created by Ryn on 2016/8/7. * 入口文件 */ import '../style/style.css'; import React from 'react'; import ReactDOM from 'react-dom'; import Calendar from '../components/Calendar'; const App = React.createClass({ getInitialState() { return { tags : [5, 21] } }, selectDate(year, month, day) { console.log("选择时间为:" + year + '年' + month + '月' + day + '日' ); }, previousMonth(year, month) { console.log("当前日期为:" + year + '年' + month + '月'); this.setState({tags : [7, 11]}); }, nextMonth(year, month) { console.log("当前日期为:" + year + '年' + month + '月'); this.setState({tags : [8, 23]}); }, render() { return ( ); } }); ReactDOM.render( , document.getElementById('datePicker') );