diff options
author | afc163 <afc163@gmail.com> | 2017-04-14 17:22:58 +0800 |
---|---|---|
committer | afc163 <afc163@gmail.com> | 2017-04-14 17:22:58 +0800 |
commit | 5b1086548164afd65cf4a5cbb7ec1f92cd5e2b9e (patch) | |
tree | d5c8b096944cd0648b04983cdf0630ade3a94151 /examples/open.html | |
parent | bc74c14f3cb8ea2d2b242563dbe9963b6491ade4 (diff) | |
download | time-picker-5b1086548164afd65cf4a5cbb7ec1f92cd5e2b9e.tar.gz time-picker-5b1086548164afd65cf4a5cbb7ec1f92cd5e2b9e.tar.zst time-picker-5b1086548164afd65cf4a5cbb7ec1f92cd5e2b9e.zip |
Updates
Diffstat (limited to 'examples/open.html')
-rw-r--r-- | examples/open.html | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/examples/open.html b/examples/open.html index 7b1c639..4acdd0f 100644 --- a/examples/open.html +++ b/examples/open.html | |||
@@ -2,7 +2,7 @@ | |||
2 | <html> | 2 | <html> |
3 | 3 | ||
4 | <head> | 4 | <head> |
5 | <title>open.js - example - rc-time-picker@2.3.3</title> | 5 | <title>open.js - example - rc-time-picker@2.3.4</title> |
6 | <meta name="viewport" | 6 | <meta name="viewport" |
7 | content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"> | 7 | content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"> |
8 | <meta charset="utf-8"/> | 8 | <meta charset="utf-8"/> |
@@ -263,7 +263,7 @@ Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-lic | |||
263 | <body> | 263 | <body> |
264 | <div class="container"> | 264 | <div class="container"> |
265 | <div class="header"> | 265 | <div class="header"> |
266 | <h1>rc-time-picker@2.3.3</h1> | 266 | <h1>rc-time-picker@2.3.4</h1> |
267 | 267 | ||
268 | <p>React TimePicker</p> | 268 | <p>React TimePicker</p> |
269 | </div> | 269 | </div> |
@@ -277,20 +277,18 @@ Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-lic | |||
277 | <span class="hljs-keyword">import</span> ReactDom <span class="hljs-keyword">from</span> <span class="hljs-string">'react-dom'</span>; | 277 | <span class="hljs-keyword">import</span> ReactDom <span class="hljs-keyword">from</span> <span class="hljs-string">'react-dom'</span>; |
278 | <span class="hljs-keyword">import</span> TimePicker <span class="hljs-keyword">from</span> <span class="hljs-string">'rc-time-picker'</span>; | 278 | <span class="hljs-keyword">import</span> TimePicker <span class="hljs-keyword">from</span> <span class="hljs-string">'rc-time-picker'</span>; |
279 | 279 | ||
280 | <span class="hljs-keyword">const</span> App = React.createClass({ | 280 | <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">App</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">React</span>.<span class="hljs-title">Component</span> </span>{ |
281 | getInitialState() { | 281 | state = { |
282 | <span class="hljs-keyword">return</span> { | 282 | open: <span class="hljs-literal">false</span>, |
283 | open: <span class="hljs-literal">false</span>, | 283 | }; |
284 | }; | 284 | setOpen = ({ open }) => { |
285 | }, | ||
286 | setOpen({ open }) { | ||
287 | <span class="hljs-keyword">this</span>.setState({ open }); | 285 | <span class="hljs-keyword">this</span>.setState({ open }); |
288 | }, | 286 | } |
289 | toggleOpen() { | 287 | toggleOpen = () => { |
290 | <span class="hljs-keyword">this</span>.setState({ | 288 | <span class="hljs-keyword">this</span>.setState({ |
291 | open: !<span class="hljs-keyword">this</span>.state.open, | 289 | open: !<span class="hljs-keyword">this</span>.state.open, |
292 | }); | 290 | }); |
293 | }, | 291 | } |
294 | render() { | 292 | render() { |
295 | <span class="hljs-keyword">return</span> ( | 293 | <span class="hljs-keyword">return</span> ( |
296 | <span class="xml"><span class="hljs-tag"><<span class="hljs-title">div</span>></span> | 294 | <span class="xml"><span class="hljs-tag"><<span class="hljs-title">div</span>></span> |
@@ -298,8 +296,8 @@ Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-lic | |||
298 | <span class="hljs-tag"><<span class="hljs-title">TimePicker</span> <span class="hljs-attribute">open</span>=<span class="hljs-value">{this.state.open}</span> <span class="hljs-attribute">onOpen</span>=<span class="hljs-value">{this.setOpen}</span> <span class="hljs-attribute">onClose</span>=<span class="hljs-value">{this.setOpen}</span> /></span> | 296 | <span class="hljs-tag"><<span class="hljs-title">TimePicker</span> <span class="hljs-attribute">open</span>=<span class="hljs-value">{this.state.open}</span> <span class="hljs-attribute">onOpen</span>=<span class="hljs-value">{this.setOpen}</span> <span class="hljs-attribute">onClose</span>=<span class="hljs-value">{this.setOpen}</span> /></span> |
299 | <span class="hljs-tag"></<span class="hljs-title">div</span>></span> | 297 | <span class="hljs-tag"></<span class="hljs-title">div</span>></span> |
300 | )</span>; | 298 | )</span>; |
301 | }, | 299 | } |
302 | }); | 300 | } |
303 | 301 | ||
304 | ReactDom.render( | 302 | ReactDom.render( |
305 | <span class="xml"><span class="hljs-tag"><<span class="hljs-title">App</span> /></span>, | 303 | <span class="xml"><span class="hljs-tag"><<span class="hljs-title">App</span> /></span>, |