時間日期 React元件
Name | Type | Description |
---|---|---|
name | string | input name |
tiemSwitch | boolean | select time switch |
max | String | ex:"2018-12-30" |
min | String | ex:"2018-01-01" |
Name | Type | Description |
---|---|---|
callBackReturn | Object | this.functionName.bind(this) |
import Datetime from './calendar';
npm run online;
http://localhost:8003 or http://0.0.0.0:8003
constructor(props){
super(props);
this.state = {
form : {
startDate : ""
}
}
}
.
.
.
test( val ){
let form = this.state.form;
form[val.name] = val['value'];
this.setState({
form : form
})
}
.
.
.
render(){
return <Datetime tiemSwitch="true" name="startDate" callBackReturn={this.test.bind(this)}/>
}
timeSwitch="false" | timeSwitch="true" |
---|---|
max="2018-06-24" | min="2018-06-11" |
---|---|