重构 DirectoryCard 组件,替换 VPathField 为 PathInput;删除不再使用的 PathField 组件;更新 CronInput 组件以支持 v-model 绑定;添加 CronField 组件以简化 CRON 表达式输入

This commit is contained in:
jxxghp
2025-01-11 20:20:05 +08:00
parent 3023214072
commit 88c86f49bf
6 changed files with 77 additions and 21 deletions

View File

@@ -3,7 +3,7 @@ import api from '@/api'
import { FileItem } from '@/api/types'
const props = defineProps({
cron: {
modelValue: {
type: String,
default: '* * * * *',
},
@@ -14,8 +14,15 @@ const emit = defineEmits(['update:modelValue'])
const currentCron = ref(props.cron)
watch(currentCron, newVal => {
emit('update:modelValue', currentCron.value)
emit('update:modelValue', newVal)
})
watch(
() => props.modelValue,
value => {
currentCron.value = value
},
)
</script>
<template>
@@ -24,7 +31,11 @@ watch(currentCron, newVal => {
<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" />
<VList>
<VListItem>
<VCronVuetify v-model="currentCron" locale="zh-CN" :chip-props="{ color: 'success' }" class="mt-1" />
</VListItem>
</VList>
</VMenu>
</div>
</template>