Vue HtmlEditor - toolbar.items.commands

An array of AI commands.

name

The command name.

options

Command options.

Type: any

Only the following commands include predefined options:

  • changeStyle:

    • "formal"
    • "informal"
    • "technical"
    • "business"
    • "creative"
    • "journalistic"
    • "academic"
    • "persuasive"
    • "narrative"
    • "expository"
    • "descriptive"
    • "conversational"
  • changeTone:

    • "professional"
    • "casual"
    • "straightforward"
    • "confident"
    • "friendly"
  • translate

    • "Arabic"
    • "Chinese"
    • "English"
    • "French"
    • "German"
    • "Japanese"
    • "Spanish"

If you use these commands without declaring the options array, all predefined options are available. You can assign only specific options or add custom options:

App.vue
  • <template>
  • <DxHtmlEditor
  • :ai-integration="aiIntegration"
  • >
  • <DxToolbar>
  • <DxItem name="ai">
  • <DxCommand name="translate" :options="translateOptions" />
  • </DxItem>
  • </DxToolbar>
  • </DxHtmlEditor>
  • </template>
  • <script setup lang="ts">
  • import { DxHtmlEditor, DxToolbar, DxItem, DxCommand } from 'devextreme-vue/html-editor';
  • // ...
  • const translateOptions = ['English', 'German', 'Chinese', 'Lithuanian'];
  • </script>

The "custom" command can also include custom options.

prompt

A custom prompt.

Type:

Function

Function parameters:
param:

String

Prompt parameters.

Return Value:

String

The prompt text.

text

The command title.

Type:

String