• ThinkEditorKit的使用 详见demo 《ThinkEditor.Vue3.Kit.Demo》
步骤 功能 ThinkEditor ThinkEditorKit 说明 注意
step1 初始化Kit editorKit = new ThinkEditorKit() 按需创建Kit对象,可在应用生命周期内使用
step2 创建editor editor = new ThinkEditor()
editor.Init()
editor = await editorKit.CreateEditorAsync() kit.CreateEditorAsync内部实现了new ThinkEditor()、editor.Init()
step3 加载显示 editor.Load() editorKit.Load() 或 await editorKit.LoadAsync() 旧模式每个editor都需要由应用Load。新模式只需要应用对Kit Load一次, Kit内部会自动对editor进行Load操作 注意调用时机,不是直接替换editor.Load()。Kit一般new后Load一次即可。
step4 移除显示 editor.UnLoad() 无 旧模式每个editor都需要由应用UnLoad。新模式Kit自动管理其内部的editor Load or UnLoad 移除editor.UnLoad()
step5 释放editor内存 editor.UnInit() editorKit.CloseEditor(editor) or editorKit.CloseAllEditors() 旧模式每个editor都需要由应用UnInit。新模式必需由Kit.CloseEditor(editor)来移除editor引用和释放editor内存 Kit对象本身是js对象,占用内存很小,无需专门释放Kit, 其生命周期跟随浏览器管理
文档更新时间: 2026-10-28 19:19   作者:admin