diff --git a/src/components/tiptap/HbAdminTipTap.vue b/src/components/tiptap/HbAdminTipTap.vue index 2c575ed..b397258 100644 --- a/src/components/tiptap/HbAdminTipTap.vue +++ b/src/components/tiptap/HbAdminTipTap.vue @@ -11,7 +11,7 @@ import {onBeforeUnmount, onMounted, watch} from "vue"; let editor editor = useEditor({ - content: `

`, + content: ``, extensions: [ StarterKit ], diff --git a/src/components/tiptap/components/HbTiptapColorPicker.vue b/src/components/tiptap/components/HbTiptapColorPicker.vue new file mode 100644 index 0000000..edad05c --- /dev/null +++ b/src/components/tiptap/components/HbTiptapColorPicker.vue @@ -0,0 +1,68 @@ + + + + + \ No newline at end of file diff --git a/src/components/tiptap/components/HbTiptapMenuBar.vue b/src/components/tiptap/components/HbTiptapMenuBar.vue index 0331c18..5e0a692 100644 --- a/src/components/tiptap/components/HbTiptapMenuBar.vue +++ b/src/components/tiptap/components/HbTiptapMenuBar.vue @@ -2,6 +2,8 @@ import HbTiptapMenuItem from './HbTiptapMenuItem.vue' import {NPopover} from 'naive-ui' import HbTiptapTableCreator from "@/components/tiptap/components/HbTiptapTableCreator"; +import HbTiptapColorPicker from "@/components/tiptap/components/HbTiptapColorPicker"; +import {ref} from "vue"; const props = defineProps({ editor: { @@ -28,6 +30,16 @@ function insertTable(r,c) { props.editor.chain().focus().insertTable({rows: r, cols: c, withHeaderRow: true}).run() } +const color = ref("#000000") +function setColor(){ + props.editor.chain().focus().setColor(color.value).run() +} + +function updateColor(e){ + color.value = e + setColor() +} +