描述
主要用于WEB版编辑器启动时参数设置。
参数
参数名 | 必填 | 类型 | 说明 | 备注 |
---|---|---|---|---|
lib | 否 | string | ThinkEditor.wasm 资源文件路径 | 原始文件在demo工程’public\static\editor’目录中,配置路径应用按实际部署访问路径配置 |
fontPath | 否 | string | 字体文件路径 | 原始文件在demo工程’public\static\editor_fonts’目录中,配置路径应用按实际部署访问路径配置 |
logLevel | 否 | E_LOG_LEVEL | 日志打印级别 | |
useInnerUI | 否 | bool | 是否使用内置配置UI | 0: 否 1:是 |
useInnerMenuBox | 否 | bool | 是否使用内置右键菜单 | 0: 否 1:是 |
auth | 是 | json | 演示模式授权(Demonstration) 或是 正式授权(Register) | |
forbidCallAutoSetInputFocus | 否 | bool | 调用编辑器接口时,是否禁止编辑器自动获得输入焦点 | 0: 默认 自动获得输入焦点 1:不自动获得输入焦点 |
字体行为控制
参数名 | 必填 | 类型 | 说明 | 备注 |
---|---|---|---|---|
forbidLocalFonts | 否 | bool | 是否禁用本地字体功能 | 0: 否 1:是。用于环境不使用https(ssl)时,不弹出”不支持本地字体”异常提示 |
debugFont | 否 | bool | 是否调试字体管理器 | 0: 否 1:是。用于环境使用https(ssl)时,不支持本地字体功能的浏览器,不弹出”不支持本地字体”异常提示 |
示例代码
//Editor: 初始化编辑器
let thinkEditorParam = {
lib: '/editor/',
fontPath: '/editor_fonts/',
docName: docName,
logLevel: E_LOG_LEVEL.Debug, //E_LOG_LEVEL.Warn
//debugMouseMove: true,
useInnerUI: true,
useInnerMenuBox: false,
auth: { mode: E_SYSTEM_AUTH_MODE.Demonstration },
//auth: { mode: E_SYSTEM_AUTH_MODE.Register, company: '信译', organ: '江东第一人民医院' },
//defaultElementBeginBorder: '[',
//defaultElementEndBorder: ']',
forbidCallAutoSetInputFocus: true
};
var thinkEditor = new ThinkEditor(thinkEditorParam);
文档更新时间: 2025-04-23 21:35 作者:admin