mirror of
https://github.com/keven1024/015.git
synced 2026-06-05 11:59:35 +00:00
feat(front): update FormButton to prevent default click behavior and add MarkdownInputField component for rich text input
This commit is contained in:
@@ -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>
|
||||
|
||||
20
front/components/Field/MarkdownInputField.vue
Normal file
20
front/components/Field/MarkdownInputField.vue
Normal 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>
|
||||
Reference in New Issue
Block a user