跳到主要内容

CodeEditorExpose

Defined in: code-editor-vue/src/code-editor.types.ts:166

defineExpose 暴露给模板 ref 的命令式 API。

Remarks​

四个成员与 React 的 CodeEditorHandle、Angular 组件实例上的同名成员 逐字对齐(CEA-009)—— 跨端迁移时命令式面不需要改写。

Properties​

host​

readonly host: HTMLDivElement | null;

Defined in: code-editor-vue/src/code-editor.types.ts:170

宿主 div 元素(CodeMirror 挂载所在的容器),未挂载或已卸载时为 null。


view​

readonly view: EditorView | null;

Defined in: code-editor-vue/src/code-editor.types.ts:168

底层 CodeMirror EditorView,未挂载或已卸载时为 null。

Methods​

blur()​

blur(): void;

Defined in: code-editor-vue/src/code-editor.types.ts:172

移开键盘焦点;未挂载时是空操作。

Returns​

void


focus()​

focus(): void;

Defined in: code-editor-vue/src/code-editor.types.ts:174

把键盘焦点交给编辑器内容区域;未挂载时是空操作。

Returns​

void