Problem
筆者在使用 vue.js 需要對一個 input 框進行 cron 表達式校驗。
Solution
使用 npm 安裝 cron-validator 模塊:
$ npm install cron-validator
vue.js 中使用:
import { isValidCron } from 'cron-validator'
if (isValidCron('* * * * *') {
// Do something
}
效果:

