DocumentionUmo Editor NextToolbar Extensions

Toolbar Extensions

Through toolbar extensions, you can add custom menu groups to the toolbar for personalized configuration. You can also integrate with the page aside to add custom content or manually control the toolbar’s visibility.

Default Configuration

const defaultOptions = {
  // Toolbar extension configuration
  toolbar: {
    menus: [
      'base',
      'insert',
      'table',
      'tools',
      'page',
      'view',
      'import',
      'export',
    ],
    extensions: [],
  },
}

Configuration Description

toolbar.extensions

Description:Toolbar menu group extension.

Type:Array

Default Value:[]

Example

extensions: [
  { title: 'Office Assistant', key: 'office' },
  { title: 'Extension Plugins', key: 'plugins' },
]

Each item in the array represents a group.

Configuration Items

  • title:Group display name.
  • key:Group unique identifier, is the important basis for slot injection, must be unique and cannot be duplicated with default group identifier. Values such as base, insert, table, tools, page, and export cannot be set.

Slot Configuration

The slot setting is the same as the standard toolbar slot format, the identifier is #toolbar_{key} and is processed based on the key value in the extension configuration item.

Other toolbar slot configurations see Slot List.。

Example

<template #toolbar_office="props">
  <span>toolbar_office slot:{{ props }}</span>
</template>
<template #toolbar_plugins="props">
  <span>toolbar_plugins slot:{{ props }}</span>
</template>