/** * @description examples entry * @author wangfupeng */ import { createEditor, createToolbar, Boot, i18nChangeLanguage } from '@wangeditor/editor' import module from '../src/index' Boot.registerModule(module) // i18nChangeLanguage('en') // 创建编辑器 const editor = createEditor({ selector: '#editor-container', config: { hoverbarKeys: { formula: { menuKeys: ['editFormula'], // “编辑”菜单 }, }, onChange(editor) { const html = editor.getHtml() // @ts-ignore document.getElementById('text-html').value = html const contentStr = JSON.stringify(editor.children, null, 2) // @ts-ignore document.getElementById('text-json').value = contentStr }, }, // content: [ // { // // @ts-ignore // type: 'paragraph', // children: [ // { text: 'hello world' }, // // @ts-ignore // { type: 'formula', value: 'c = \\pm\\sqrt{a^1 + b^2}', children: [{ text: '' }] }, // ], // }, // ], html: `
hello world100