feat: auto refresh completion
This commit is contained in:
@@ -11,6 +11,7 @@ const editMode = ref<boolean>(false);
|
||||
const task = defineModel<Task>({ required: true });
|
||||
const editName = ref<string>('');
|
||||
const editCron = ref<string|null>(null);
|
||||
const refreshKey = ref<number>(0);
|
||||
const checked = computed<boolean>(() => {
|
||||
if (task.value.check_date === null) {
|
||||
return false;
|
||||
@@ -54,6 +55,9 @@ function check() {
|
||||
onBeforeMount(() => {
|
||||
editName.value = task.value.name;
|
||||
editCron.value = task.value.reset_cron;
|
||||
setInterval(() => {
|
||||
refreshKey.value++;
|
||||
}, 60000);
|
||||
});
|
||||
watch(task, () => {
|
||||
if (!editMode.value && task.value.name !== editName.value) {
|
||||
@@ -68,7 +72,7 @@ watch(task, () => {
|
||||
<template>
|
||||
<div class="list-row text-left">
|
||||
<div class="content-center">
|
||||
<input type="checkbox" class="checkbox" :checked="checked" @click.prevent="check" />
|
||||
<input :id="refreshKey.toFixed(0)" type="checkbox" class="checkbox" :checked="checked" @click.prevent="check" />
|
||||
</div>
|
||||
<div
|
||||
v-if="!editMode"
|
||||
|
||||
Reference in New Issue
Block a user