|
@@ -11,23 +11,50 @@ import Calendar from '../components/Calendar';
|
|
|
|
|
|
const App = React.createClass({
|
|
const App = React.createClass({
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 初始状态
|
|
|
|
+ * @returns {{tags: number[]}}
|
|
|
|
+ */
|
|
getInitialState() {
|
|
getInitialState() {
|
|
return {
|
|
return {
|
|
tags : [5, 21]
|
|
tags : [5, 21]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 选择日期
|
|
|
|
+ * @param year
|
|
|
|
+ * @param month
|
|
|
|
+ * @param day
|
|
|
|
+ */
|
|
selectDate(year, month, day) {
|
|
selectDate(year, month, day) {
|
|
console.log("选择时间为:" + year + '年' + month + '月' + day + '日' );
|
|
console.log("选择时间为:" + year + '年' + month + '月' + day + '日' );
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 上一个月
|
|
|
|
+ * @param year
|
|
|
|
+ * @param month
|
|
|
|
+ */
|
|
previousMonth(year, month) {
|
|
previousMonth(year, month) {
|
|
console.log("当前日期为:" + year + '年' + month + '月');
|
|
console.log("当前日期为:" + year + '年' + month + '月');
|
|
this.setState({tags : [7, 11]});
|
|
this.setState({tags : [7, 11]});
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 下一个月
|
|
|
|
+ * @param year
|
|
|
|
+ * @param month
|
|
|
|
+ */
|
|
nextMonth(year, month) {
|
|
nextMonth(year, month) {
|
|
console.log("当前日期为:" + year + '年' + month + '月');
|
|
console.log("当前日期为:" + year + '年' + month + '月');
|
|
this.setState({tags : [8, 23]});
|
|
this.setState({tags : [8, 23]});
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 组件渲染
|
|
|
|
+ * @returns {XML}
|
|
|
|
+ */
|
|
render() {
|
|
render() {
|
|
return (
|
|
return (
|
|
<Calendar
|
|
<Calendar
|