|
|
|
@ -3,7 +3,7 @@
|
|
|
|
name="edit"
|
|
|
|
name="edit"
|
|
|
|
@keydown.ctrl.s.prevent="submit(note)">
|
|
|
|
@keydown.ctrl.s.prevent="submit(note)">
|
|
|
|
<template #content>
|
|
|
|
<template #content>
|
|
|
|
<div class="flex w-full justify-between">
|
|
|
|
<div class="sticky top-0 flex w-full justify-between">
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
@click="toggleComp('text')"
|
|
|
|
@click="toggleComp('text')"
|
|
|
|
class="bg-lightgray w-1/2 p-2 text-center text-xl"
|
|
|
|
class="bg-lightgray w-1/2 p-2 text-center text-xl"
|
|
|
|
@ -21,9 +21,8 @@
|
|
|
|
<textarea
|
|
|
|
<textarea
|
|
|
|
ref="noteTextArea"
|
|
|
|
ref="noteTextArea"
|
|
|
|
v-show="comp === 'text'"
|
|
|
|
v-show="comp === 'text'"
|
|
|
|
class="bg-secondary h-fit w-full flex-grow resize-none border-none p-4 outline-none placeholder:text-zinc-700 focus:outline-none"
|
|
|
|
class="bg-secondary min-h-screen w-full flex-grow resize-none border-none p-4 outline-none placeholder:text-zinc-700 focus:outline-none"
|
|
|
|
@input="resizeNoteTextArea()"
|
|
|
|
v-model="input">
|
|
|
|
v-model="note.description">
|
|
|
|
|
|
|
|
</textarea>
|
|
|
|
</textarea>
|
|
|
|
<CardMarkdownRenderer
|
|
|
|
<CardMarkdownRenderer
|
|
|
|
v-show="comp === 'md'"
|
|
|
|
v-show="comp === 'md'"
|
|
|
|
@ -48,13 +47,8 @@
|
|
|
|
const isSubmitting = ref<Boolean>(false)
|
|
|
|
const isSubmitting = ref<Boolean>(false)
|
|
|
|
const isDeleting = ref<Boolean>(false)
|
|
|
|
const isDeleting = ref<Boolean>(false)
|
|
|
|
const comp = ref<Comp>('text')
|
|
|
|
const comp = ref<Comp>('text')
|
|
|
|
const noteTextArea = ref()
|
|
|
|
|
|
|
|
const description = useDescription()
|
|
|
|
const description = useDescription()
|
|
|
|
|
|
|
|
const { textarea: noteTextArea, input } = useTextareaAutosize()
|
|
|
|
const resizeNoteTextArea = () => {
|
|
|
|
|
|
|
|
noteTextArea.value.style.height = '18px'
|
|
|
|
|
|
|
|
noteTextArea.value.style.height = noteTextArea.value.scrollHeight + 'px'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const toggleComp = (name: Comp) => {
|
|
|
|
const toggleComp = (name: Comp) => {
|
|
|
|
comp.value = name
|
|
|
|
comp.value = name
|
|
|
|
@ -75,7 +69,7 @@
|
|
|
|
note.value.title = response._data.note.title
|
|
|
|
note.value.title = response._data.note.title
|
|
|
|
note.value.description = response._data.note.description
|
|
|
|
note.value.description = response._data.note.description
|
|
|
|
description.value = note.value.description
|
|
|
|
description.value = note.value.description
|
|
|
|
resizeNoteTextArea()
|
|
|
|
input.value = note.value.description
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
@ -110,6 +104,7 @@
|
|
|
|
() => note.value.description,
|
|
|
|
() => note.value.description,
|
|
|
|
() => {
|
|
|
|
() => {
|
|
|
|
description.value = note.value.description
|
|
|
|
description.value = note.value.description
|
|
|
|
|
|
|
|
input.value = note.value.description
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|