feat: only use one watcher
This commit is contained in:
parent
f5c7b5be82
commit
5dac96a2d5
1 changed files with 6 additions and 6 deletions
|
@ -54,7 +54,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {computed, nextTick, ref, watch} from 'vue'
|
import {computed, nextTick, ref, watch, watchEffect} from 'vue'
|
||||||
import TaskCollectionService from '@/services/taskCollection'
|
import TaskCollectionService from '@/services/taskCollection'
|
||||||
import TaskService from '@/services/task'
|
import TaskService from '@/services/task'
|
||||||
import {format, parse} from 'date-fns'
|
import {format, parse} from 'date-fns'
|
||||||
|
@ -174,11 +174,11 @@ async function loadTasks() {
|
||||||
mapGanttBars()
|
mapGanttBars()
|
||||||
}
|
}
|
||||||
|
|
||||||
loadTasks()
|
watchEffect(() => loadTasks({
|
||||||
|
dateTo: props.dateTo,
|
||||||
watch(() => props.dateTo, loadTasks)
|
dateFrom: props.dateFrom,
|
||||||
watch(() => props.dateFrom, loadTasks)
|
showTasksWithoutDates: props.showTasksWithoutDates,
|
||||||
watch(() => props.showTasksWithoutDates, loadTasks)
|
}))
|
||||||
|
|
||||||
async function updateTask(e) {
|
async function updateTask(e) {
|
||||||
const task = tasks.value.get(e.bar.ganttBarConfig.id)
|
const task = tasks.value.get(e.bar.ganttBarConfig.id)
|
||||||
|
|
Loading…
Reference in a new issue