fix: edit mode not opening for task modal

This commit is contained in:
Shariq Ansari 2024-07-01 13:10:44 +05:30
parent 4695af0877
commit 64b8766401

View File

@ -205,24 +205,23 @@ async function updateTask() {
show.value = false show.value = false
} }
onMounted(() => { function render() {
_task.value = { ...props.task } editMode.value = false
}) nextTick(() => {
title.value.el.focus()
_task.value = { ...props.task }
if (_task.value.title) {
editMode.value = true
}
})
}
watch( onMounted(() => render())
() => show.value,
(value) => { watch(show, (value) => {
if (!value) return if (!value) return
editMode.value = false render()
nextTick(() => { })
title.value.el.focus()
_task.value = { ...props.task }
if (_task.value.title) {
editMode.value = true
}
})
}
)
</script> </script>
<style scoped> <style scoped>