feat(front): update FormButton to prevent default click behavior and add MarkdownInputField component for rich text input

This commit is contained in:
keven1024
2025-04-17 09:06:20 +08:00
parent eb866a70c7
commit 220a936a10
2 changed files with 24 additions and 1 deletions

View File

@@ -1,5 +1,8 @@
<template>
<Button @click="() => emit('click', form)" :disabled="!isValid">
<Button type="button" @click="(e) => {
e.preventDefault()
emit('click', form)
}" :disabled="!isValid">
<slot />
</Button>
</template>

View File

@@ -0,0 +1,20 @@
<template>
<Field :name="props.name" v-slot="{ field }">
<div class="flex flex-col gap-2">
<Label v-if="props.label">{{ props.label }}</Label>
<div class="border rounded-md">
<Tiptap v-bind="field" />
</div>
</div>
</Field>
</template>
<script setup lang="ts">
import Tiptap from '@/components/Tiptap.vue'
const props = defineProps<{
name: string
label?: string
placeholder?: string
}>()
</script>