From 978b98bdc59e6ce5ec682953fcfe4830138e6f65 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Sun, 20 Aug 2023 15:34:13 +0200 Subject: [PATCH] extract edit note component --- src/components/StackedNote.vue | 16 ++++------- src/modules/note/components/EditNote.vue | 35 ++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 src/modules/note/components/EditNote.vue diff --git a/src/components/StackedNote.vue b/src/components/StackedNote.vue index 4177e09..0b67efc 100644 --- a/src/components/StackedNote.vue +++ b/src/components/StackedNote.vue @@ -15,6 +15,10 @@ const LinkedNotes = defineAsyncComponent( () => import('@/components/LinkedNotes.vue') ) +const EditNote = defineAsyncComponent( + () => import('@/modules/note/components/EditNote.vue') +) + const props = defineProps<{ user: string repo: string @@ -46,7 +50,7 @@ const toggleMode = () => { mode.value = mode.value === 'read' ? 'edit' : 'read' } -watch(content, () => { +watch([content, mode], () => { if (!content.value) { return } @@ -92,7 +96,7 @@ watch(content, () => { share
- +
@@ -154,14 +158,6 @@ $border-color: rgba(18, 19, 58, 0.2); } } -textarea { - width: 100%; - height: 100%; - border: none; - flex: 1; - resize: none; -} - @media screen and (max-width: 768px) { .stacked-note { padding: 0 0.5rem 1rem; diff --git a/src/modules/note/components/EditNote.vue b/src/modules/note/components/EditNote.vue new file mode 100644 index 0000000..811818e --- /dev/null +++ b/src/modules/note/components/EditNote.vue @@ -0,0 +1,35 @@ + + + + +