Default Configuration
Compared with Umo Editor and Umo Editor Next, the mobile configuration is more focused on touch-first reading, switching between read and edit modes, the save state machine, and lightweight integration. It does not include all desktop appearance and toolbar configuration items.
Full Configuration
const defaultOptions = {
editorKey: 'default',
locale: 'zh-CN',
theme: 'light',
debug: false,
dicts: {
fonts: [...],
colors: [...],
lineHeights: [...],
symbols: [...],
emojis: [...],
pageSizes: [...],
},
page: {
layouts: ['web', 'page'],
defaultMargin: {
left: 3.18,
right: 3.18,
top: 2.54,
bottom: 2.54,
},
defaultOrientation: 'portrait',
defaultBackground: '#fff',
showBreakMarks: true,
showLineNumber: false,
showBookmark: false,
watermark: {
type: 'compact',
alpha: 0.2,
fontColor: '#000',
fontSize: 16,
fontFamily: 'SimSun',
fontWeight: 'normal',
text: '',
},
},
document: {
title: '',
content: '',
placeholder: {
en_US: 'Please enter the document content...',
zh_CN: '请输入文档内容...',
},
structure: 'block+',
enableSpellcheck: true,
enableMarkdown: true,
enableBubbleMenu: true,
enableBlockMenu: true,
enableNodeId: false,
readOnly: false,
autofocus: false,
characterLimit: 0,
typographyRules: {},
editorProps: {},
parseOptions: {
preserveWhitespace: 'full',
},
autoSave: {
enabled: true,
interval: 300000,
},
},
echarts: {
mode: 1,
renderImage: false,
onCustomSettings() {
return null
},
},
templates: [],
cdnUrl: 'https://unpkg.com/@umoteam/editor-external@latest',
shareUrl: location.href || '',
file: {
allowedMimeTypes: [],
maxSize: 1024 * 1024 * 100,
},
user: {},
users: [],
extensions: [],
disableExtensions: [],
translations: {
en_US: {},
zh_CN: {},
},
async onLeave({ leaveSteps = 1 } = {}) {
window.history.go(-Math.max(1, Number(leaveSteps) || 1))
},
async onSave() {
throw new Error('Key "onSave": Please set the save method')
},
async onRename() {
throw new Error('Key "onRename": Please set the rename method')
},
async onFileUpload(file) {
if (!file) {
throw new Error('File not found')
}
throw new Error('Key "onFileUpload": Please set the upload method')
},
onFileDelete() {
console.error('The file has been deleted...')
},
}Configuration Overview
editorKey: editor instance identifier, used to distinguish local persisted state.locale/theme/debug: global display, theme, and debugging capability configuration. See Localization Configuration, Theme Configuration, and Debug Configuration.dicts: dictionary configuration. See Dictionary Configuration.page: page configuration. See Page Configuration.document: document configuration. See Document Configuration.echarts: ECharts configuration. See ECharts Configuration.templates: template configuration. See Document Template Configuration.cdnUrl/shareUrl: resource base URL and share URL configuration.file: file upload and preview configuration. See File Upload Configuration.user/users: user information configuration. See User Configuration and Related Users Configuration.extensions/disableExtensions: extension add/remove configuration. See Feature and Extension Configuration.translations: localization override configuration. See Localization Configuration.onLeave/onSave/onRename/onFileUpload/onFileDelete: callback method configuration. See Method Configuration.
Key Differences from Desktop
debugMobile-Only: controls whether the built-in DevTools entry is available in the “More” panel.onLeaveMobile-Only: handles mobile back navigation, page leaving, and navigation behavior after unsaved-change confirmation.onRenameMobile-Only: handles document rename from the “More” panel.page.layoutsdefaults to['web', 'page']Different on Mobile, which means mobile enters web layout by default; desktop usually prioritizes paged view.file.previewDifferent on Mobile: mobile does not support third-party preview through URL templates.
Configuration Items Not Supported on Mobile
skinNot SupportedheightNot SupportedfullscreenZIndexNot SupportedtoolbarNot SupportedwebPagesNot SupporteddiagramsNot Supported
⚠️
The mobile configuration documentation is intentionally focused on what is actually supported in the current mobile product. For desktop-only items, please refer to the desktop documentation instead of assuming the same support boundary on mobile.