qnn-react-cron
qnn-react-cron copied to clipboard
是否可以暴露change事件出来
组件内任意form.Item在change的时候可以暴露到外面,可以方便用户实时更新cron表达式,而不用通过click生成按钮去触发更新数据
interval 做了个假的
useEffect(() => {
const timer = setInterval(() => {
fnsRef.current && onChange?.(fnsRef.current.getValue())
}, 200)
return () => {
clearInterval(timer)
}
}, [])
最新版中增加 onChange api
// onChange 事件,当值改变时触发
// @param type = "second" | "minute" | "hour" | "day" | "month" | "week" | "year"
// @param value = string
onChange={({ type, value })=>{
console.log( type, value )
}}