diff options
Diffstat (limited to 'examples/value-and-defaultValue.js')
-rw-r--r-- | examples/value-and-defaultValue.js | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/examples/value-and-defaultValue.js b/examples/value-and-defaultValue.js new file mode 100644 index 0000000..42ef647 --- /dev/null +++ b/examples/value-and-defaultValue.js | |||
@@ -0,0 +1,85 @@ | |||
1 | webpackJsonp([1],{ | ||
2 | |||
3 | /***/ 0: | ||
4 | /***/ function(module, exports, __webpack_require__) { | ||
5 | |||
6 | module.exports = __webpack_require__(229); | ||
7 | |||
8 | |||
9 | /***/ }, | ||
10 | |||
11 | /***/ 229: | ||
12 | /***/ function(module, exports, __webpack_require__) { | ||
13 | |||
14 | /* eslint no-console:0 */ | ||
15 | |||
16 | 'use strict'; | ||
17 | |||
18 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
19 | |||
20 | __webpack_require__(2); | ||
21 | |||
22 | var _react = __webpack_require__(3); | ||
23 | |||
24 | var _react2 = _interopRequireDefault(_react); | ||
25 | |||
26 | var _reactDom = __webpack_require__(160); | ||
27 | |||
28 | var _reactDom2 = _interopRequireDefault(_reactDom); | ||
29 | |||
30 | var _gregorianCalendar = __webpack_require__(161); | ||
31 | |||
32 | var _gregorianCalendar2 = _interopRequireDefault(_gregorianCalendar); | ||
33 | |||
34 | var _gregorianCalendarFormat = __webpack_require__(165); | ||
35 | |||
36 | var _gregorianCalendarFormat2 = _interopRequireDefault(_gregorianCalendarFormat); | ||
37 | |||
38 | var _gregorianCalendarLibLocaleZh_CN = __webpack_require__(168); | ||
39 | |||
40 | var _gregorianCalendarLibLocaleZh_CN2 = _interopRequireDefault(_gregorianCalendarLibLocaleZh_CN); | ||
41 | |||
42 | var _rcTimePicker = __webpack_require__(169); | ||
43 | |||
44 | var _rcTimePicker2 = _interopRequireDefault(_rcTimePicker); | ||
45 | |||
46 | var _rcTimePickerSrcLocaleZh_CN = __webpack_require__(227); | ||
47 | |||
48 | var _rcTimePickerSrcLocaleZh_CN2 = _interopRequireDefault(_rcTimePickerSrcLocaleZh_CN); | ||
49 | |||
50 | var formatter = new _gregorianCalendarFormat2['default']('HH:mm:ss'); | ||
51 | |||
52 | var now = new _gregorianCalendar2['default'](_gregorianCalendarLibLocaleZh_CN2['default']); | ||
53 | now.setTime(Date.now()); | ||
54 | |||
55 | var App = _react2['default'].createClass({ | ||
56 | displayName: 'App', | ||
57 | |||
58 | getInitialState: function getInitialState() { | ||
59 | return { | ||
60 | value: now | ||
61 | }; | ||
62 | }, | ||
63 | handleValueChange: function handleValueChange(value) { | ||
64 | console.log(value && formatter.format(value)); | ||
65 | this.setState({ value: value }); | ||
66 | }, | ||
67 | render: function render() { | ||
68 | return _react2['default'].createElement( | ||
69 | 'div', | ||
70 | null, | ||
71 | _react2['default'].createElement(_rcTimePicker2['default'], { formatter: formatter, locale: _rcTimePickerSrcLocaleZh_CN2['default'], | ||
72 | defaultValue: now }), | ||
73 | _react2['default'].createElement(_rcTimePicker2['default'], { formatter: formatter, locale: _rcTimePickerSrcLocaleZh_CN2['default'], | ||
74 | value: this.state.value, | ||
75 | onChange: this.handleValueChange }) | ||
76 | ); | ||
77 | } | ||
78 | }); | ||
79 | |||
80 | _reactDom2['default'].render(_react2['default'].createElement(App, null), document.getElementById('__react-content')); | ||
81 | |||
82 | /***/ } | ||
83 | |||
84 | }); | ||
85 | //# sourceMappingURL=value-and-defaultValue.js.map \ No newline at end of file | ||