Skip to content

AtMonacoEditor

沈孟平
最后更新于 2025-11-18 14:57:11

一个支持 naive 表单状态的编辑器,并且通过 cdn 加载 monaco-editor 实例,速度超快噢~

代码演示

API

AtMonacoEditor Props

名称类型默认值说明版本
optionsIStandaloneDiffEditorConstructionOptions{ readOnly: false, language: 'shell' }创建编辑器实例的选项
default-valuestringundefined编辑器的默认值
value stringundefined编辑器输入的值
fullscreen-btnAtIconButtonPropsundefined全屏按钮配置
on-blurfunctionundefined编辑器失去焦点时触发
on-focusfunctionundefined编辑器获得焦点时触发
on-changefunctionundefined编辑器change 事件触发时触发
on-update:valuefunctionundefined编辑器值更新时触发

AtMonacoEditor Events

名称参数说明版本
blur()编辑器失去焦点时触发
focus()编辑器获得焦点时触发
change(value: string)编辑器内容改变时触发
update:value(value: string)编辑器值更新时触发(用于 v-model)
updateValue(value: string)编辑器值更新时触发(兼容性事件)

AtMonacoEditor Expose

名称类型说明版本
editor-insteditor.IStandaloneDiffEditor | null编辑器的实例v0.12.25

changelog

5ceaf - feat(components): 增加编辑器示例的类型提示 on 2025/8/20
b7b7f - feat(components): monaco fullscreen icon replace on 2025/4/24
17093 - feat(components): monaco add `fullscreen-btn` prop on 2025/4/24
28d9b - fix(components): 继续尝试修复 monaco worker 加载失败 on 2024/9/26
0b26d - fix(components): 继续尝试修复 monaco worker 加载失败 on 2024/9/26
9d8a3 - fix(components): monaco worker 加载失败 on 2024/9/26
665e8 - fix(components): initMonaco 在其他项目中使用报错 on 2024/9/26
03044 - feat(components): 编辑器不再采用 cdn 方式,避免无外网情况无法加载 on 2024/9/26
9d698 - fix(AtMonacoEditor): 重新采用 loader , 更换 cdn 地址 on 2024/9/3
7f24a - fix(AtMonacoEditor): 尝试修复引入报错 on 2024/9/2

贡献者

Last updated: