Added vuetify-pro-tiptap for html formating.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import {useLabelEditorStore} from "~/store/labelEditorStore";
|
||||
import {originToString} from "~/types/origin";
|
||||
import DeleteConfirm from "~/components/ui/deleteConfirm.vue";
|
||||
import type {Ref} from "vue";
|
||||
|
||||
@@ -150,6 +149,7 @@
|
||||
:hint="store.settings.bio"
|
||||
persistent-placeholder
|
||||
persistent-hint
|
||||
:readonly="!edit"
|
||||
/>
|
||||
</v-row>
|
||||
|
||||
@@ -160,6 +160,7 @@
|
||||
:hint="store.settings.mhd"
|
||||
persistent-placeholder
|
||||
persistent-hint
|
||||
:readonly="!edit"
|
||||
/>
|
||||
</v-row>
|
||||
</v-col>
|
||||
@@ -172,24 +173,17 @@
|
||||
:hint="store.settings.bio_info"
|
||||
persistent-placeholder
|
||||
persistent-hint
|
||||
:readonly="!edit"
|
||||
/>
|
||||
</v-row>
|
||||
<v-row no-gutters>
|
||||
<v-textarea
|
||||
v-model.trim="store.articleEdit.description"
|
||||
:tile=true
|
||||
<VuetifyTiptap
|
||||
v-model="store.articleEdit.description"
|
||||
label="Beschreibung"
|
||||
counter
|
||||
:persistentCounter=true
|
||||
rows="6"
|
||||
no-resize
|
||||
:readonly="!edit"
|
||||
persistent-placeholder
|
||||
>
|
||||
<template v-slot:counter="{ counter }">
|
||||
<span>{{ counter }} von {{ store.ingredientsMaxChars }} Zeichen.</span>
|
||||
</template>
|
||||
</v-textarea>
|
||||
rounded
|
||||
:max-height="200"
|
||||
:disabled="!edit"
|
||||
/>
|
||||
</v-row>
|
||||
</v-col>
|
||||
|
||||
@@ -201,6 +195,7 @@
|
||||
:hint="store.settings.allergens_text"
|
||||
persistent-placeholder
|
||||
persistent-hint
|
||||
:readonly="!edit"
|
||||
/>
|
||||
</v-row>
|
||||
<v-row no-gutters>
|
||||
|
||||
@@ -3,10 +3,49 @@ import '@mdi/font/css/materialdesignicons.css'
|
||||
|
||||
import 'vuetify/styles'
|
||||
import { createVuetify } from 'vuetify'
|
||||
import {
|
||||
BaseKit,
|
||||
Bold,
|
||||
Clear,
|
||||
Heading,
|
||||
History,
|
||||
Indent,
|
||||
Table,
|
||||
TextAlign,
|
||||
VuetifyTiptap,
|
||||
createVuetifyProTipTap,
|
||||
} from 'vuetify-pro-tiptap'
|
||||
|
||||
import 'vuetify/styles'
|
||||
import 'vuetify-pro-tiptap/styles/editor.css'
|
||||
import 'vuetify-pro-tiptap/styles/markdown.css'
|
||||
|
||||
const vuetifyProTipTap = createVuetifyProTipTap({
|
||||
lang: 'de',
|
||||
markdownTheme: 'github',
|
||||
components: {
|
||||
VuetifyTiptap,
|
||||
},
|
||||
extensions: [
|
||||
BaseKit.configure({
|
||||
placeholder: {
|
||||
placeholder: 'Enter some text...'
|
||||
},
|
||||
}),
|
||||
Bold,
|
||||
Heading,
|
||||
TextAlign,
|
||||
Clear.configure({ divider: true }),
|
||||
Indent.configure({ divider: true }),
|
||||
Table.configure({ divider: true }),
|
||||
History.configure({ divider: true }),
|
||||
]
|
||||
})
|
||||
|
||||
export default defineNuxtPlugin((app) => {
|
||||
const vuetify = createVuetify({
|
||||
// ... your configuration
|
||||
})
|
||||
app.vueApp.use(vuetify)
|
||||
app.vueApp.use(vuetifyProTipTap)
|
||||
})
|
||||
|
||||
@@ -273,8 +273,6 @@ export const useLabelEditorStore = defineStore('label_editor_store', {
|
||||
|
||||
async updateArticle(article: Article) {
|
||||
if (this.article != null) {
|
||||
console.log(article);
|
||||
|
||||
try {
|
||||
let updatedArticle = await $fetch<Article>(this.config.public.url + '/article/' + article.id, {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user