-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need more explanation regarding custom plugin #10
Comments
I created this simple demo for you. you can check it Create The Custom Bold Menu Button In your custom extension class, add a {
component: // your vue component
componentProps: {
// props will pass to your vue component
},
componentEvents: {
// handle events that your component emit
},
}
Also you can overwrite such as schema, plugins and commands in your custom extension class like in tiptap. create-custom-extensions If you want to render multiple buttons in one extension, just like you say the Heading extension. your can return a class Bold extends OriginalBold {
menuBtnView () {
return [
{
component: componentH1,
},
{
component: componentH2,
}
...
];
}
} i will make the docs more detailed. I'm glad to reply if you have any other questions. thanks for supporting this project. |
Do you still have any questions? |
Hey |
@Leecason Trying to render multiple buttons in the extension as per your last example works for rendering buttons but the logic within component events is not firing. Perhaps I have the syntax incorrect??
|
@shadrachtuck menuBtnView (editorContext) {
return [
{
component: compA,
componentProps: compAprops,
componentEvents: compAevents,
},
{
component: compB,
componentProps: compBprops,
componentEvents: compBevents,
},
...
],
} |
@Leecason oh of course! brilliant, thank you! |
How do I create custom extension, say for Heading?
In the doc it is mentioned to extend the Base Class, but what if I want to add a custom class to it?
Is it similar to tiptap, wherein the we need to define it in the schema/doc?
Also can you explain what menuBtnView (editorContext) {} expects and needs to return.
Thanks.
Great work on the plugin!
The text was updated successfully, but these errors were encountered: