阅读器主要用于草稿模式编辑或单纯的内容显示,需要实时协同显示并且设置为不可编辑,可以使用引擎的 readonly
属性
在实例化阅读器时传入
import { View } from '@aomao/engine';//实例化引擎const view = new View(渲染节点, {...配置项,});
string
zh-CN
zh-CN
、en-US
。可使用 locale
配置const view = new View(渲染节点, {lang: 'zh-CN',});
object
zh-CN
语言包,默认语言包 https://github.com/big-camel/am-editor/blob/master/locale
const view = new View(渲染节点, {locale: {'zh-CN': {test: '测试',a: {b: 'B',},},},});console.log(view.language.get<string>('test'));
Node
Array<Plugin>
[]
Plugin
抽象类的插件集合Array<Card>
[]
Card
抽象类的卡片集合{ [key: string]: PluginOptions }
{}
Node | (() => Node | null)
overflow
或者 overflow-y
为 auto
或者 scroll
的节点,如果没有就取 document.documentElement
scroll
事件设置弹层浮动位置和主动设置滚动到编辑器目标位置boolena
true