Tiptap: Single File vue Component example

Created on 5 Nov 2018  路  5Comments  路  Source: ueberdosis/tiptap

Is it possible to have an example of using our ready SFCs when creating out extensions? I saw the Iframe sample and I was wondering how to do something like it using an SFC.

Most helpful comment

Hey @panayotisk! You can already do that.

import { Node } from 'tiptap'
import CustomComponent from './CustomComponent.vue'

export default class CustomNode extends Node {

    get name() {
        return 'custom_node'
    }

    get view() {
        return CustomComponent
    }

}

All 5 comments

Hey @panayotisk! You can already do that.

import { Node } from 'tiptap'
import CustomComponent from './CustomComponent.vue'

export default class CustomNode extends Node {

    get name() {
        return 'custom_node'
    }

    get view() {
        return CustomComponent
    }

}

@philippkuehn is there also a way to set the SFC component's parent? I need to access the vuex store and it would also be helpful to see its properties in chrome dev tools as is suggested here: https://github.com/buefy/buefy/issues/55#issuecomment-343859081
Or should I use a different approach?

A good point. Didn't know that!

I added this parent option in [email protected]. Thanks for the hint!

Great! Thank you for that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ageeye-cn picture ageeye-cn  路  3Comments

pk-pressf1 picture pk-pressf1  路  3Comments

leandromatos picture leandromatos  路  4Comments

agentq15 picture agentq15  路  3Comments

asseti6 picture asseti6  路  3Comments