Currently utilizing TipTap
, a Rich Text Editor
that implements props in vue components (composition api) by importing them as follows:
<script>
import { nodeViewProps } from '@tiptap/vue-3'
export default {
props: nodeViewProps
}
</script>
Upon logging nodeViewProps
, it displays an object of objects
:
{0: false, 1: true, editor: {…}, node: {…}, decorations: {…}, selected: {…}, extension: {…}, …}
0: false
1: true
decorations: {required: true, type: ƒ}
deleteNode: {required: true, type: ƒ}
editor: {required: true, type: ƒ}
extension: {required: true, type: ƒ}
getPos: {required: true, type: ƒ}
node: {required: true, type: ƒ}
selected: {required: true, type: ƒ}
updateAttributes: {required: true, type: ƒ}
[[Prototype]]: Object
The challenge lies in importing this prop object
within the context of script setup
. I've attempted various approaches without success:
<script setup>
import {nodeViewProps} from '@tiptap/vue-3'
const props = defineProps([
nodeViewProps
])
const props = defineProps([
'nodeViewProps'
])
const props = defineProps({
nodeViewProps: nodeViewProps
})
const props = defineProps({
node: nodeViewProps
})
</script>
Unfortunately, none of the above methods appear to be correct.
console.log(props.nodeViewProps)
This statement results in undefined
being outputted.