Skip to content

Crontab Component

Create and edit Cron expressions, you might not need it

Example

vue
vue
<template>
  <div>
    <n-input-group>
      <n-input
        v-model:value="cronExpression"
        placeholder="Please enter or generate an expression"
        clearable
      />
      <n-button type="primary" @click="() => crontabRef?.open()">
        <template #icon>
          <Icones icon="ant-design:clock-circle-outlined" />
        </template>
        Generate Expression
      </n-button>
    </n-input-group>

    <!-- Expression Generator -->
    <Crontab ref="crontab" v-model="cronExpression" />
  </div>
</template>

<script lang="ts" setup>
const crontabRef = useTemplateRef("crontab");

const cronExpression = ref("0 0 0 * * ?");
</script>

Props

NameTypeRequiredDefaultDescription
v-modelStringNo""Cron expression

Expose

Function NameParamsDescription
open() => voidMethod to open the expression generator modal

Contributors

Changelog

Released under the MIT License