From 8992554ba6ebe632f761982cb4e0049b0a9e02aa Mon Sep 17 00:00:00 2001 From: James Collins Date: Fri, 7 Jul 2023 16:40:23 +1000 Subject: [PATCH] started toolbar --- resources/js/components/SMEditor.vue | 219 ++++++++++++++++++++++++--- 1 file changed, 197 insertions(+), 22 deletions(-) diff --git a/resources/js/components/SMEditor.vue b/resources/js/components/SMEditor.vue index d8ffdaf..31e9344 100644 --- a/resources/js/components/SMEditor.vue +++ b/resources/js/components/SMEditor.vue @@ -1,7 +1,156 @@ @@ -14,24 +163,22 @@ const props = defineProps({ modelValue: { type: String, required: true, - } + }, }); const emits = defineEmits(["update:modelValue"]); const editor = useEditor({ content: props.modelValue, - extensions: [ - StarterKit, - ], + extensions: [StarterKit], onUpdate: () => { emits("update:modelValue", editor.value.getHTML()); - } + }, }); onBeforeUnmount(() => { editor.value.destroy(); -}) +}); watch( () => props.modelValue, @@ -43,21 +190,49 @@ watch( } editor.value.commands.setContent(newValue, false); - } + }, ); \ No newline at end of file + button { + display: flex; + background-color: rgba(255, 255, 255, 1); + color: rgba(75, 85, 99, 1); + padding: 0.25rem; + margin: 0.25rem; + background-color: rgba(255, 255, 255, 1); + + svg { + height: 1.2rem; + width: 1.2rem; + } + } + + button.is-active { + background-color: red; + } + } + + .ProseMirror { + border-width: 1px; + border-radius: 0 0 0.5rem 0.5rem; + border-color: rgba(156, 163, 175, 0.5) rgba(156, 163, 175, 1) + rgba(156, 163, 175, 1); + color: rgba(75, 85, 99, 1); + padding: 1rem; + background-color: rgba(255, 255, 255, 1); + height: 24rem; + overflow: scroll; + outline: none; + } +} +