Slot plugins
Slot plugins render components. Content such as code, links and headings is already prepared; you choose its presentation and interactions.
Declare and use a plugin
This example hides the code toolbar while keeping the default highlighting and code styles. Declare the plugin in its own module:
Then pass it to the component:
Import the plugin base class and prop types from
@fluxdown/vue-plugins/base. Install@fluxdown/vue-pluginsfirst.
key identifies the plugin, type selects a slot, and Component supplies a Vue component. A stateless component can be a function. Use defineComponent with explicit props when you need reactive state or lifecycle hooks.
Keep the default behavior
Raw is the component supplied by the previous plugin. Call it to preserve existing highlighting or layout, then change individual props to adjust part of its behavior.
At the same priority, later plugins for a slot wrap earlier components through Raw. Return your own VNode to replace it entirely. Pass child content through the children prop or Vue's default slot.
Rawcan benull. Check it before use.
Choose a slot
Each slot has its own prop type, such as LinkProps or HeadingProps. Use Render plugins to change which slot handles a HAST node.