mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-06-06 00:01:33 +08:00
添加 VCronInput 公共组件,用于快速录入CRON表达式
This commit is contained in:
30
src/components/input/CronInput.vue
Normal file
30
src/components/input/CronInput.vue
Normal 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>
|
||||
Reference in New Issue
Block a user