react-schedule-ui
v1.0.3
Published
react的定时任务ui
Downloads
5
Readme
基于React的定时任务操作库
安装
npm install react-schedule-ui --save
使用
import CronUI from 'react-schedule-ui/lib/cron';
class App extends React.Component {
constructor() {
super()
this.state = {
cronText: '* * * * * *',
};
}
handleCronChange = (cronText) => {
this.setState({
cronText
})
}
render() {
return (
<div>
<CronUI
cronText="* * * * * *"
onCronChange = {this.handleCronChange}
/>
<div style={{ width: '100%', display: 'flex', justifyContent: 'center', marginTop: '10px' }}>
<span>{this.state.cronText}</span>
</div>
</div>
)
}
}
cronText : cron表达式。 onCronChange: 界面发生改变后, 回调回来的cron表达式