/** * @description disable 内容编辑 * @author lichunlin */ import Editor from '../index' import $, { DomElement } from '../../utils/dom-core' import '../../assets/style/disable.less' export default function disableInit(editor: Editor) { let isCurtain: Boolean = false // 避免重复生成幕布 let $contentDom: DomElement let $menuDom: DomElement // 禁用期间,通过 js 修改内容后,刷新内容 editor.txt.eventHooks.changeEvents.push(function () { if (isCurtain) { $contentDom.find('.w-e-content-preview').html(editor.$textElem.html()) } }) // 创建幕布 function disable() { if (isCurtain) return // 隐藏编辑区域 editor.$textElem.hide() // 生成div 渲染编辑内容 let textContainerZindexValue = editor.zIndex.get('textContainer') const content = editor.txt.html() $contentDom = $( `