Render plugins
Render plugins convert HAST nodes into Uni App render descriptions. Each description contains a slot name, props, and children for the .uvue components to display. Prefer Slot plugins when only the presentation needs to change.
Match and render
This example sends blockquote nodes to the Blockquote slot:
Import
BaseUniRenderPlugin,createTypeOfSlot, node helpers, and render parameter types from@fluxdown/uni-app-plugins/base.
match decides whether to handle a node. renderChildren continues rendering its children, and getProps preserves node properties. createTypeOfSlot returns a callable description builder; it does not instantiate a component.
Register the plugin
Pass QuotePlugin through the component's plugins prop. Full and Lite already include a Blockquote slot; Raw requires its slot plugins explicitly.
Return values
render can return text, numbers, null, arrays of those values, or slot descriptions. To display your own .uvue component directly, return { component, props, key? }:
Citationis a component implemented by your application. Import the return type,UniRenderNode, from@fluxdown/uni-app-plugins/typings.
At equal priority, later render plugins match first. A lower priority runs earlier. See Composite plugins to combine related render, slot, and parser plugins.