For AI agents: the complete documentation index is available at /vue-codemirror6/zh/llms.txt, the full documentation bundle is available at /vue-codemirror6/zh/llms-full.txt, and this page is available as Markdown at /vue-codemirror6/zh/api/props.md.
  • 简体中文
  • Props

    在模板中使用短横线命名(tab-size),在 JavaScript 中使用驼峰命名(tabSize)。

    内容

    Prop类型默认值说明
    model-valuestring | Text''文本内容。配合 v-model 使用(不是 value)。
    placeholderstring | HTMLElementundefined文本为空时显示。参见 placeholder。
    tagstring'div'根元素的标签名。

    预设

    Prop类型默认值说明
    basicbooleanfalse启用 basicSetup。
    minimalbooleanfalse启用 minimalSetup。以 basic 为准。

    编辑

    Prop类型默认值说明
    readonlybooleanfalse禁止修改,但仍可聚焦。参见 readOnly。
    disabledbooleanfalse不可编辑且不可聚焦。为 editable 的反值。
    wrapbooleanfalse启用 自动换行。
    tabbooleanfalse按 Tab 键缩进(indentWithTab)。
    tab-sizenumberundefined制表符宽度。
    indent-unitstringundefined缩进单位。
    allow-multiple-selectionsbooleanfalse允许多重选区。
    line-separatorstringundefined换行符。未指定时为 \n。
    keymapKeyBinding[][]自定义 快捷键。

    语言与代码检查

    Prop类型默认值说明
    langLanguageSupportundefined语法高亮的语言。参见 语言列表。
    linterLintSourceundefined代码检查源,例如 jsonParseLinter() 或 esLint(...)。
    linter-configobject{}代码检查配置。
    force-lintingbooleanfalse立即运行代码检查。参见 forceLinting。
    gutterbooleanfalse显示 检查边栏。需要 linter。
    gutter-configobjectundefined检查边栏配置。

    外观

    Prop类型默认值说明
    darkbooleanfalse将编辑器主题标记为深色。
    themeRecord<string, StyleSpec>{}传给 EditorView.theme 的样式定义。
    phrasesRecord<string, string>undefined界面翻译。

    滚动

    Prop类型默认值说明
    scroll-into-viewbooleantrue外部更新 modelValue 时滚动到选区。参见 scrollIntoView。
    preserve-scroll-positionbooleanfalse外部更新 modelValue 时保持滚动位置。参见 scrollSnapshot。

    扩展

    Prop类型默认值说明
    extensionsExtension[][]额外的 扩展,追加在由 props 生成的扩展之后。