View configuration

The reader is mainly used for draft mode editing or simple content display. It needs real-time collaborative display and is set to be non-editable. You can use the engine's readonly attribute

Passed in when instantiating the reader

import {View} from'@aomao/engine';
//Instantiate the view
const view = new View(render node, {
... configuration items,


  • Type: string
  • Default value: zh-CN
  • Detailed: Language configuration, temporarily supports zh-CN, en-US. Can use locale configuration
const view = new View(render node, {


  • Type: object
  • Default value: zh-CN
  • Detailed: Configure additional language packs

Language pack, default language pack []( locale)

const view = new View(render node, {
locale: {
'zh-CN': {
a: {
b: "B"


  • Type: Node
  • Default value: the parent node of the current reader render node
  • Detailed: Reader root node


  • Type: Array<Plugin>
  • Default value: []
  • Detailed: A collection of plugins that implement the abstract class of Plugin


  • Type: Array<Card>
  • Default value: []
  • Detailed: Implement the card collection of the Card abstract class


  • Type: { [key: string]: PluginOptions }
  • Default value: {}
  • Detailed: the configuration item of each plugin, the key is the name of the plugin, please refer to the description of each plugin for detailed configuration


  • Type: Node | (() => Node | null)
  • Default value: Find the node whose parent style overflow or overflow-y is auto or scroll, if not, take document.documentElement
  • Detailed: The editor scroll bar node is mainly used to monitor the scroll event to set the floating position of the bomb layer and actively set the scroll to the editor target position


  • Type: boolena
  • Default value: true
  • Detailed: Lazy rendering of cards (only cards with lazyRender enabled), the default is true