-
Using Nuxt with Directus. I'm trying to render Tiptap's headings using a custom Heading.vue component. However, I'm running into this warning which I can't figure out the reason for:
What's needed to fix this? I've added this to the array of const componentSerializers: VueComponentSerializers = [
{
name: 'heading',
type: 'node',
render: (attrs) =>
[Heading, {...attrs}]
},
] // Heading.vue
<template>
<component :is="`h${level}`" :style="headingStyle" class="my-component">
<slot />
</component>
</template>
<script setup lang="ts">
import { computed } from 'vue';
const props = defineProps<{
level: number;
textAlign?: string;
}>();
const headingStyle = computed(() => {
return props.textAlign ? { textAlign: props.textAlign } : {};
});
</script> |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
BTW, this is also the case when using the Textfield.vue component that's part of the example. |
Beta Was this translation helpful? Give feedback.
-
This has to do with the tiptap-render-view package and the way the JSON structure is passed to the |
Beta Was this translation helpful? Give feedback.
-
The answer is a bit confusing, is this fixable? What would the implemented fix look like in the code @djmtype provided? |
Beta Was this translation helpful? Give feedback.
This has to do with the tiptap-render-view package and the way the JSON structure is passed to the
renderView
function.