mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-07-12 16:01:35 +08:00
重构 DirectoryCard 组件,替换 VPathField 为 PathInput;删除不再使用的 PathField 组件;更新 CronInput 组件以支持 v-model 绑定;添加 CronField 组件以简化 CRON 表达式输入
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user