-
{{ t("text.uploadText") }}
-
-
-
+
+
{{ t('text.uploadText') }}
+
+
+
+
+
+
{
+ const { text } = form?.values || {}
+ showDrawer({
+ render: ({ hide }) =>
+ h(TextShareDrawer, {
+ hide,
+ text,
+ onTextHandle: handleTextShare,
+ }),
+ })
+ }
+ "
+ >
+ {{ t('btn.submit') }}
+
+
+
-
-
{
- const { text } = form?.values || {};
- showDrawer({
- render: ({ hide }) =>
- h(TextShareDrawer, {
- hide,
- text,
- onTextHandle: handleTextShare,
- }),
- });
- }
- "
- >
- {{ t("btn.submit") }}
-
-
-
-
diff --git a/front/components/Tiptap.vue b/front/components/Tiptap/Index.vue
similarity index 65%
rename from front/components/Tiptap.vue
rename to front/components/Tiptap/Index.vue
index 56442f5..5e01987 100644
--- a/front/components/Tiptap.vue
+++ b/front/components/Tiptap/Index.vue
@@ -3,9 +3,12 @@ import { Editor, EditorContent } from '@tiptap/vue-3'
import StarterKit from '@tiptap/starter-kit'
import { Markdown } from 'tiptap-markdown'
import Placeholder from '@tiptap/extension-placeholder'
+import { cx } from 'class-variance-authority'
+
const props = defineProps<{
modelValue?: string
placeholder?: string
+ class?: string
}>()
const emit = defineEmits<{
(e: 'update:modelValue', value: string): void
@@ -27,14 +30,14 @@ onMounted(() => {
// CommandsPlugin,
],
onUpdate: () => {
- emit('update:modelValue', editor.value?.storage?.markdown?.getMarkdown() ?? '')
+ emit('update:modelValue', (editor.value as any)?.storage?.markdown?.getMarkdown() ?? '')
},
})
})
watch(
() => props.modelValue,
(value) => {
- if (value !== editor.value?.storage?.markdown?.getMarkdown()) {
+ if (value !== (editor.value as any)?.storage?.markdown?.getMarkdown()) {
editor.value?.commands.setContent(value ?? '')
}
}
@@ -45,7 +48,13 @@ onUnmounted(() => {
+ :editor="editor as any"
+ :class="
+ cx(
+ 'prose prose-sm bg-white/50 rounded-md p-2 [&>*]:outline-none prose-p:my-1 prose-headings:my-2 prose-pre:mb-0 prose-blockquote:border-black/50 selection:bg-primary/20 max-w-full',
+ props.class
+ )
+ "
+ >
+