添加 VCronInput 公共组件,用于快速录入CRON表达式

This commit is contained in:
jxxghp
2025-01-11 13:28:46 +08:00
parent 047e99e27c
commit afa333243f
10 changed files with 108 additions and 85 deletions

View File

@@ -0,0 +1,30 @@
<script setup lang="ts">
import api from '@/api'
import { FileItem } from '@/api/types'
const props = defineProps({
cron: {
type: String,
default: '* * * * *',
},
})
const emit = defineEmits(['update:modelValue'])
const currentCron = ref(props.cron)
watch(currentCron, newVal => {
emit('update:modelValue', currentCron.value)
})
</script>
<template>
<div>
<VMenu :close-on-content-click="false" content-class="cursor-default">
<template v-slot:activator="{ props }">
<slot name="activator" :menuprops="props" />
</template>
<VCronVuetify v-model="currentCron" locale="zh-CN" :chip-props="{ color: 'success' }" class="mt-1" />
</VMenu>
</div>
</template>