Vizel API / vue/src / createVizelSlashMenuRenderer
Function: createVizelSlashMenuRenderer()
ts
function createVizelSlashMenuRenderer(options?): Partial<SuggestionOptions<VizelCommand>>;Defined in: packages/vue/src/composables/createVizelSlashMenuRenderer.ts:42
Creates a suggestion render configuration for the SlashCommand extension. This handles the popup positioning and Vue component lifecycle.
The menu renders VizelCommandSpec items derived from the unified VizelCommand registry. Selecting an item maps its id back to the matching command and forwards it to Tiptap's props.command, which runs the command after the extension deletes the slash trigger text.
Parameters
| Parameter | Type |
|---|---|
options | VizelSuggestionRendererOptions |
Returns
Partial<SuggestionOptions<VizelCommand>>
Example
ts
import { createVizelSlashMenuRenderer } from '@vizel/vue';
import { VizelSlashCommand } from '@vizel/core';
const editor = new Editor({
extensions: [
VizelSlashCommand.configure({
suggestion: createVizelSlashMenuRenderer(),
}),
],
});