mirror of
https://github.com/keven1024/015.git
synced 2026-06-08 13:24:33 +00:00
Revert "refactor(front): replace MarkdownInputField with RichInputField for improved JSON handling in text uploads, update Tiptap component to support JSONContent, and increment dependency versions for better compatibility"
This reverts commit e959a0bc3e.
This commit is contained in:
13
front/components/Field/MarkdownInputField.vue
Normal file
13
front/components/Field/MarkdownInputField.vue
Normal file
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<Tiptap v-model="value" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Tiptap from '@/components/Tiptap.vue'
|
||||
import type { RuleExpression } from 'vee-validate'
|
||||
const props = defineProps<{
|
||||
name: string
|
||||
rules?: RuleExpression<string>
|
||||
}>()
|
||||
const { value, } = useField<string>(props.name, props.rules)
|
||||
</script>
|
||||
@@ -1,20 +0,0 @@
|
||||
<template>
|
||||
<Tiptap :model-value="jsonValue" @update:model-value="(v) => setValue(JSON.stringify(v))" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Tiptap from '@/components/Tiptap.vue'
|
||||
import type { RuleExpression } from 'vee-validate'
|
||||
const props = defineProps<{
|
||||
name: string
|
||||
rules?: RuleExpression<string>
|
||||
}>()
|
||||
const { value, setValue } = useField<string>(props.name, props.rules)
|
||||
const jsonValue = computed(() => {
|
||||
try {
|
||||
return value.value ? JSON.parse(value.value) : {}
|
||||
} catch (error) {
|
||||
return {}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user