You can pass prosemirror plugins to your extensions. There are some editor props you can use 鈥撀爄n your case it's handleClick.
import { Node, Plugin } from 'tiptap'
export default class CustomNode extends Node {
get name() {
return 'custom_node'
}
get schema() {
// schema
}
get plugins() {
return [
new Plugin({
props: {
handleClick(view, pos) {
// do something
},
},
}),
]
}
}
Thanks. That is helpful. But it brings a new problem. I can not visit this. Is it possible to get the Vue instance in functon handleClick? For now, my solution is to store some variables through using LocalStorage, then I can visit these variables in CustomNode.js. But I really want to find a way to visit this directly in handleClick.
Or maybe we can register these editor props when the Editor is initialized?
Like this.
new Editor({
handleClick: ( view, pos, event) => {} . // now it is not supported
})
Most helpful comment
You can pass prosemirror plugins to your extensions. There are some editor props you can use 鈥撀爄n your case it's
handleClick.