Documention
Events

Events

This section will introduce the events of Umo Editor. Through events, you can listen to the complete lifecycle and state changes of Umo Editor for more operations. You can visit https://demo.umodoc.com/editor?tab=events&lang=en, open the console (DevTools › Console) to view the triggering of events.

Example

<template>
  <umo-editor
    v-bind="options"
    @before-create="onBeforeCreate"
    @created="onCreated"
    @changed="onChanged"
    @changed:selection="onChangedSelection"
    @changed:transaction="onChangedTransaction"
    @changed:menu="onChangedMenu"
    @changed:toolbar="onChangedToolbar"
    @changed:page-size="onChangedPageSize"
    @changed:page-orientation="onChangedPageOrientation"
    @changed:page-margin="onChangedPageMargin"
    @changed:page-background="onChangedPageBackground"
    @changed:page-zoom="onChangedZoom"
    @changed:page-show-toc="onChangedPageShowToc"
    @changed:page-preview="onChangedPreview"
    @changed:page-watermark="onChangedPageWatermark"
    @changed:locale="onChangedLocale"
    @print="onPrint"
    @focus="onFocus"
    @blur="onBlur"
    @saved="onSaved"
    @destroy="onDestroy"
  />
</template>
 
<script setup>
  import { ref \} from 'vue';
  import { UmoEditor \} from '@umoteam/editor';
 
  const options = ref({
    // Configuration options
    // ...
  });
 
  // Event handler functions go here ...
  // onBeforeCreate, onCreated, onChanged, etc.
</script>

Event Description

Event NameTrigger Timing / DescriptionAvailable Parameters
beforeCreateEditor is about to be created-
createdEditor has been created{ editor }
changedEditor content has been updated{ editor }
changed:selectionSelected content has changed{ editor }
changed:transactionEditor state has changed{ editor, transaction }
changed:menuMenu state has changedcurrentMenu
changed:toolbarToolbar information has changed{ toolbar, oldToolbar }
changed:pageSizePage size information has changed{ pageSize, oldPageSize }
changed:pageOrientationPage orientation has changed{ pageOrientation, oldPageOrientation }
changed:pageMarginPage margin information has changed{ pageMargin, oldPageMargin }
changed:pageBackgroundPage background has changed{ pageBackground, oldPageBackground }
changed:pageZoomPage zoom level has changed{ zoomLevel, oldZoomLevel }
changed:pageShowTocPage outline panel display state has changedshowToc
changed:pagePreviewPage preview mode has changedenabled
changed:pageWatermarkPage watermark information has changed{ pageWatermark, oldPageWatermark }
changed:localeLanguage setting has changed Added in v2.0.0{ locale, oldLocale }
printPage print Added in v1.1.0-
focusEditor gains focus{ editor, event }
blurEditor loses focus{ editor, event }
savedDocument has been saved-
destroyEditor component has been destroyed-