react-monaco-editor 属性配置

{
         /**
         * 允许调整“差异编辑器”拆分视图的大小Defaults to true.
         */
        enableSplitViewResizing?: boolean;
        /**
         * 在两个并排编辑器中呈现差异 Defaults to true.
         */
        renderSideBySide?: boolean;
        /**
         * 取消差异计算后的延迟时间(毫秒) Defaults to 5000.
         */
        maxComputationTime?: number;
        /**
         * 计算差异是否忽略前/后空格Defaults to true.
         */
        ignoreTrimWhitespace?: boolean;
        /**
         * 为添加/删除的更改呈现+/-指示器.Defaults to true.
         */
        renderIndicators?: boolean;
        /**
         * 原来的editor是否可编辑Defaults to false.
         */
        originalEditable?: boolean;
        // 通用属性
        ...IEditorOptions

}
通用属性 IEditorOptions
{
         /**
         * 是否为diff编辑器
         */
        inDiffEditor?: boolean;
        /**
         * 编辑器聚焦时的aria标签
         */
        ariaLabel?: string;
        /**
         * 渲染指定列处的垂直线 Defaults to empty array.
         */
        rulers?: number[];
        /**
         *单词导航时使用的单词分隔符 Defaults to `~!@#$%^&*()-=+[{]}\\|;:\'",.<>/?
         */
        wordSeparators?: string;
        /**
         * 启用Linux主剪贴板 Defaults to true.
         */
        selectionClipboard?: boolean;
        /**
         * 控制行号的呈现 
         * 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string);
         * Defaults to `on`.
         */
        lineNumbers?: LineNumbersType;
        /**
         * 控制围绕光标的可见前导线和尾随线的最小数目。 Defaults to 0.
        */
        cursorSurroundingLines?: number;
        /**
         * 控件何时应强制执行“cursorcurringlines”。Defaults to `default`
        */
        cursorSurroundingLinesStyle?: 'default' | 'all';
        /**
         * 当文件以换行结束时呈现最后一行号 Defaults to true.
        */
        renderFinalNewline?: boolean;
        /**
         * 单击行号时是否应选择相应的行 Defaults to true.
         */
        selectOnLineNumbers?: boolean;
        /**
         * 控制行号的宽度,至少呈现一定数量的数字Defaults to 5.
         */
        lineNumbersMinChars?: number;
        /**
         * 启用图示符边距的渲染 Defaults to true in vscode and to false in monaco-editor.
         */
        glyphMargin?: boolean;
        /**
         * 为行装饰(行号和编辑器内容之间)保留的宽度(px). Defaults to 10.
         */
        lineDecorationsWidth?: number | string;
        /**
         * 当显示光标时,会向光标添加一个虚拟填充(px),将其变成一个矩形Defaults to 30 (px).
         */
        revealHorizontalRightPadding?: number;
        /**
         * 使用圆角边框渲染编辑器选择.Defaults to true.
         */
        roundedSelection?: boolean;
        /**
         * 要添加到编辑器的类名
         */
        extraEditorClassName?: string;
        /**
         * 是否只读 Defaults to false.
         */
        readOnly?: boolean;
        /**
         * 编辑器是否应该呈现验证装饰。Defaults to editable.
         */
        renderValidationDecorations?: 'editable' | 'on' | 'off';
        /**
         * 控制滚动条的行为和呈现--见下方滚动条属性
         */
        scrollbar?: IEditorScrollbarOptions;
        /**
         * 控制小地图的行为和呈现--见下方小地图属性
         */
        minimap?: IEditorMinimapOptions;
        /**
         * 控制find小部件的行为(查找功能)
         */
        find?: IEditorFindOptions;
        /**
         * 将溢出小部件显示为“固定”。Defaults to `false`.
         */
        fixedOverflowWidgets?: boolean;
        /**
         * The number of vertical lanes the overview ruler should render. Defaults to 3.
         */
        overviewRulerLanes?: number;
        /**
         * Controls if a border should be drawn around the overview ruler.
         * Defaults to `true`.
         */
        overviewRulerBorder?: boolean;
        /**
         * 控制光标动画样式, Defaults to 'blink'.
         */
        cursorBlinking?: 'blink' | 'smooth' | 'phase' | 'expand' | 'solid';
        /**
         *使用鼠标滚轮并按住Ctrl键时,在编辑器中缩放字体。Defaults to false.
         */
        mouseWheelZoom?: boolean;
        /**
         * 控制鼠标指针样式, Defaults to 'text'
         */
        mouseStyle?: 'text' | 'default' | 'copy';
        /**
         * 启用平滑插入符号动画 Defaults to false.
         */
        cursorSmoothCaretAnimation?: boolean;
        /**
         * 光标样式,  Defaults to 'line'.
         */
        cursorStyle?: 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin';
        /**
         * 当cursorStyle设置为“line”时,控制光标的宽度
         */
        cursorWidth?: number;
        /**
         * 设置font ligatures. Defaults to false.
         */
        fontLigatures?: boolean | string;
        /**
         * 禁止对编辑器边距和行图层使用“transform:translate3d(0px,0px,0px)”。
*“transform:translate3d(0px,0px,0px)”的用法可以作为浏览器创建额外层的提示。 Defaults to false.
         */
        disableLayerHinting?: boolean;
        /**
         * 是否禁用优化 monospace fonts. Defaults to false.
         */
        disableMonospaceOptimizations?: boolean;
        /**
         * 光标是否隐藏在概览标尺中 Defaults to false.
         */
        hideCursorInOverviewRuler?: boolean;
        /**
         * 启用滚动可以在最后一行后移动一个屏幕大小  Defaults to true.
         */
        scrollBeyondLastLine?: boolean;
        /**
         * 启用滚动可以超出最后一列的许多列.Defaults to 5.
         */
        scrollBeyondLastColumn?: number;
        /**
         * 编辑器动画效果滚动到一个位置. Defaults to false.
         */
        smoothScrolling?: boolean;
        /**
         * 编辑器将设置一个间隔时间来检查其dom节点大小是否已更改。启用此功能可能会对性能产生严重影响。
         * Defaults to false.
         */
        automaticLayout?: boolean;
        /**
         * 设置编辑器的换行.Defaults to "off".
         */
        wordWrap?: 'off' | 'on' | 'wordWrapColumn' | 'bounded';
        /**
         *  wordWrap设置为wordWrapColumn生效,Defaults to 80.
         */
        wordWrapColumn?: number;
        /**
         * 当文本显示为缩小生成的文件时强制换行.
         * Defaults to true.
         */
        wordWrapMinified?: boolean;
        /**
         *控制换行的缩进.Defaults to 'same' in vscode and to 'none' in monaco-editor.
         */
        wrappingIndent?: 'none' | 'same' | 'indent' | 'deepIndent';
        /**
         * 换行策略. Defaults to 'simple'.
         */
        wrappingStrategy?: 'simple' | 'advanced';
        /**
         * 配置换行字符。在这些字符之前将引入一个中断 Defaults to '([{‘“〈《「『【〔([{「£¥$£¥++'.
         */
        wordWrapBreakBeforeCharacters?: string;
        /**
         * 配置换行字符。在这些字符之后将引入中断 Defaults to ' \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」'.
         */
        wordWrapBreakAfterCharacters?: string;
        /**
         *停止渲染x个字符后的行 Defaults to 10000. 使用-1永不停止渲染
         */
        stopRenderingLineAfter?: number;
        /**
         * 配置hover.
         */
        hover?: {
          /**
         * 启用悬停 Defaults to true.
         */
        enabled?: boolean;
        /**
         * 悬停显示延迟时间 Defaults to 300.
         */
        delay?: number;
        /**
         * 悬停是否具有便签,以便可以单击它并选择其内容 Defaults to true.
         */
        sticky?: boolean;
      };
        /**
         * 启用检测链接并使其可单击. Defaults to true.
         */
        links?: boolean;
        /**
         * 启用内联颜色装饰器和颜色选择器渲染
         */
        colorDecorators?: boolean;
        /**
         * Control the behaviour of comments in the editor.
         */
        comments?: IEditorCommentsOptions;
        /**
         *启用自定义上下文菜单 Defaults to true.
         */
        contextmenu?: boolean;
        /**
         * A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.
         * Defaults to 1.
         */
        mouseWheelScrollSensitivity?: number;
        /**
         * FastScrolling mulitplier speed when pressing `Alt`
         * Defaults to 5.
         */
        fastScrollSensitivity?: number;
        /**
         * The modifier to be used to add multiple cursors with the mouse.
         * Defaults to 'alt'
         */
        multiCursorModifier?: 'ctrlCmd' | 'alt';
        /**
         * Merge overlapping selections.
         * Defaults to true
         */
        multiCursorMergeOverlapping?: boolean;
        /**
         * Configure the behaviour when pasting a text with the line count equal to the cursor count.
         * Defaults to 'spread'.
         */
        multiCursorPaste?: 'spread' | 'full';
        /**
         * Configure the editor's accessibility support.
         * Defaults to 'auto'. It is best to leave this to 'auto'.
         */
        accessibilitySupport?: 'auto' | 'off' | 'on';
        /**
         * Controls the number of lines in the editor that can be read out by a screen reader
         */
        accessibilityPageSize?: number;
        /**
         * Suggest options.
         */
        suggest?: ISuggestOptions;
        /**
         *
         */
        gotoLocation?: IGotoLocationOptions;
        /**
         * Enable quick suggestions (shadow suggestions)
         * Defaults to true.
         */
        quickSuggestions?: boolean | IQuickSuggestionsOptions;
        /**
         * Quick suggestions show delay (in ms)
         * Defaults to 10 (ms)
         */
        quickSuggestionsDelay?: number;
        /**
         * Parameter hint options.
         */
        parameterHints?: IEditorParameterHintOptions;
        /**
         * Options for auto closing brackets.
         * Defaults to language defined behavior.
         */
        autoClosingBrackets?: EditorAutoClosingStrategy;
        /**
         * Options for auto closing quotes.
         * Defaults to language defined behavior.
         */
        autoClosingQuotes?: EditorAutoClosingStrategy;
        /**
         * Options for typing over closing quotes or brackets.
         */
        autoClosingOvertype?: EditorAutoClosingOvertypeStrategy;
        /**
         * Options for auto surrounding.
         * Defaults to always allowing auto surrounding.
         */
        autoSurround?: EditorAutoSurroundStrategy;
        /**
         * Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.
         * Defaults to advanced.
         */
        autoIndent?: 'none' | 'keep' | 'brackets' | 'advanced' | 'full';
        /**
         * Enable format on type.
         * Defaults to false.
         */
        formatOnType?: boolean;
        /**
         * Enable format on paste.
         * Defaults to false.
         */
        formatOnPaste?: boolean;
        /**
         * Controls if the editor should allow to move selections via drag and drop.
         * Defaults to false.
         */
        dragAndDrop?: boolean;
        /**
         * Enable the suggestion box to pop-up on trigger characters.
         * Defaults to true.
         */
        suggestOnTriggerCharacters?: boolean;
        /**
         * Accept suggestions on ENTER.
         * Defaults to 'on'.
         */
        acceptSuggestionOnEnter?: 'on' | 'smart' | 'off';
        /**
         * Accept suggestions on provider defined characters.
         * Defaults to true.
         */
        acceptSuggestionOnCommitCharacter?: boolean;
        /**
         * Enable snippet suggestions. Default to 'true'.
         */
        snippetSuggestions?: 'top' | 'bottom' | 'inline' | 'none';
        /**
         * Copying without a selection copies the current line.
         */
        emptySelectionClipboard?: boolean;
        /**
         * Syntax highlighting is copied.
         */
        copyWithSyntaxHighlighting?: boolean;
        /**
         * The history mode for suggestions.
         */
        suggestSelection?: 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix';
        /**
         * The font size for the suggest widget.
         * Defaults to the editor font size.
         */
        suggestFontSize?: number;
        /**
         * The line height for the suggest widget.
         * Defaults to the editor line height.
         */
        suggestLineHeight?: number;
        /**
         * Enable tab completion.
         */
        tabCompletion?: 'on' | 'off' | 'onlySnippets';
        /**
         * Enable selection highlight.
         * Defaults to true.
         */
        selectionHighlight?: boolean;
        /**
         * Enable semantic occurrences highlight.
         * Defaults to true.
         */
        occurrencesHighlight?: boolean;
        /**
         * Show code lens
         * Defaults to true.
         */
        codeLens?: boolean;
        /**
         * Control the behavior and rendering of the code action lightbulb.
         */
        lightbulb?: IEditorLightbulbOptions;
        /**
         * Timeout for running code actions on save.
         */
        codeActionsOnSaveTimeout?: number;
        /**
         * Enable code folding.
         * Defaults to true.
         */
        folding?: boolean;
        /**
         * Selects the folding strategy. 'auto' uses the strategies contributed for the current document, 'indentation' uses the indentation based folding strategy.
         * Defaults to 'auto'.
         */
        foldingStrategy?: 'auto' | 'indentation';
        /**
         * Enable highlight for folded regions.
         * Defaults to true.
         */
        foldingHighlight?: boolean;
        /**
         * Controls whether the fold actions in the gutter stay always visible or hide unless the mouse is over the gutter.
         * Defaults to 'mouseover'.
         */
        showFoldingControls?: 'always' | 'mouseover';
        /**
         * Enable highlighting of matching brackets.
         * Defaults to 'always'.
         */
        matchBrackets?: 'never' | 'near' | 'always';
        /**
         * Enable rendering of whitespace.
         * Defaults to none.
         */
        renderWhitespace?: 'none' | 'boundary' | 'selection' | 'all';
        /**
         * Enable rendering of control characters.
         * Defaults to false.
         */
        renderControlCharacters?: boolean;
        /**
         * Enable rendering of indent guides.
         * Defaults to true.
         */
        renderIndentGuides?: boolean;
        /**
         * Enable highlighting of the active indent guide.
         * Defaults to true.
         */
        highlightActiveIndentGuide?: boolean;
        /**
         * Enable rendering of current line highlight.
         * Defaults to all.
         */
        renderLineHighlight?: 'none' | 'gutter' | 'line' | 'all';
        /**
         * Inserting and deleting whitespace follows tab stops.
         */
        useTabStops?: boolean;
        /**
         * The font family
         */
        fontFamily?: string;
        /**
         * The font weight
         */
        fontWeight?: string;
        /**
         * The font size
         */
        fontSize?: number;
        /**
         * The line height
         */
        lineHeight?: number;
        /**
         * The letter spacing
         */
        letterSpacing?: number;
        /**
         * Controls fading out of unused variables.
         */
        showUnused?: boolean;
        /**
         * Controls whether to focus the inline editor in the peek widget by default.
         * Defaults to false.
         */
        peekWidgetDefaultFocus?: 'tree' | 'editor';
}
滚动条属性 IEditorScrollbarOptions
{
        /**
         * 垂直滚动条。Defaults to 'auto'.
         */
        vertical?: 'auto' | 'visible' | 'hidden';
        /**
         * 水平滚动条.Defaults to 'auto'.
         */
        horizontal?: 'auto' | 'visible' | 'hidden';
        /**
         * 滚动内容时投射水平和垂直阴影 Defaults to true.
         */
        useShadows?: boolean;
        /**
         *渲染垂直滚动条顶部和底部的箭头。Defaults to false.
         */
        verticalHasArrows?: boolean;
        /**
         *渲染水平滚动条左右两侧的箭头 Defaults to false.
         */
        horizontalHasArrows?: boolean;
        /**
         * 箭头的大小(如果显示)。 Defaults to 11.
         */
        arrowSize?: number;
        /**
         * 监听鼠标滚轮事件并通过滚动做出反应. Defaults to true.
         */
        handleMouseWheel?: boolean;
        /**
         * 总是使用鼠标滚轮事件(总是在浏览器事件上调用preventDefault()和stopPropagation()) Defaults to true.
         */
        alwaysConsumeMouseWheel?: boolean;
        /**
         * 水平滚动条的高度(px)。Defaults to 10 (px).
         */
        horizontalScrollbarSize?: number;
        /**
         * 垂直滚动条的宽度(px)Defaults to 10 (px).
         */
        verticalScrollbarSize?: number;
        /**
         * 垂直滑块的宽度(px)。 Defaults to `verticalScrollbarSize`.
         */
        verticalSliderSize?: number;
        /**
         *水平滑块的高度(px)。 Defaults to `horizontalScrollbarSize`.
         */
        horizontalSliderSize?: number;
}
小地图属性IEditorMinimapOptions
{
 /**
         * Enable the rendering of the minimap.
         * Defaults to true.
         */
        enabled?: boolean;
        /**
         * Control the side of the minimap in editor.
         * Defaults to 'right'.
         */
        side?: 'right' | 'left';
        /**
         * Control the rendering of the minimap slider.
         * Defaults to 'mouseover'.
         */
        showSlider?: 'always' | 'mouseover';
        /**
         * Render the actual text on a line (as opposed to color blocks).
         * Defaults to true.
         */
        renderCharacters?: boolean;
        /**
         * Limit the width of the minimap to render at most a certain number of columns.
         * Defaults to 120.
         */
        maxColumn?: number;
        /**
         * Relative size of the font in the minimap. Defaults to 1.
         */
        scale?: number;
}
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 211,194评论 6 490
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,058评论 2 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 156,780评论 0 346
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,388评论 1 283
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,430评论 5 384
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,764评论 1 290
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,907评论 3 406
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,679评论 0 266
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,122评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,459评论 2 325
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,605评论 1 340
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,270评论 4 329
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,867评论 3 312
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,734评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,961评论 1 265
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,297评论 2 360
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,472评论 2 348

推荐阅读更多精彩内容