react-monaco-editor 中MonacoDiffEditor各個(gè)屬性配置

{
         /**
         * 允許調(diào)整“差異編輯器”拆分視圖的大小Defaults to true.
         */
        enableSplitViewResizing?: boolean;
        /**
         * 在兩個(gè)并排編輯器中呈現(xiàn)差異 Defaults to true.
         */
        renderSideBySide?: boolean;
        /**
         * 取消差異計(jì)算后的延遲時(shí)間(毫秒) Defaults to 5000.
         */
        maxComputationTime?: number;
        /**
         * 計(jì)算差異是否忽略前/后空格Defaults to true.
         */
        ignoreTrimWhitespace?: boolean;
        /**
         * 為添加/刪除的更改呈現(xiàn)+/-指示器.Defaults to true.
         */
        renderIndicators?: boolean;
        /**
         * 原來的editor是否可編輯Defaults to false.
         */
        originalEditable?: boolean;
        // 通用屬性
        ...IEditorOptions

}

通用屬性 IEditorOptions

{
         /**
         * 是否為diff編輯器
         */
        inDiffEditor?: boolean;
        /**
         * 編輯器聚焦時(shí)的aria標(biāo)簽
         */
        ariaLabel?: string;
        /**
         * 渲染指定列處的垂直線 Defaults to empty array.
         */
        rulers?: number[];
        /**
         *單詞導(dǎo)航時(shí)使用的單詞分隔符 Defaults to `~!@#$%^&*()-=+[{]}\\|;:\'",.<>/?
         */
        wordSeparators?: string;
        /**
         * 啟用Linux主剪貼板 Defaults to true.
         */
        selectionClipboard?: boolean;
        /**
         * 控制行號的呈現(xiàn) 
         * 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string);
         * Defaults to `on`.
         */
        lineNumbers?: LineNumbersType;
        /**
         * 控制圍繞光標(biāo)的可見前導(dǎo)線和尾隨線的最小數(shù)目。 Defaults to 0.
        */
        cursorSurroundingLines?: number;
        /**
         * 控件何時(shí)應(yīng)強(qiáng)制執(zhí)行“cursorcurringlines”。Defaults to `default`
        */
        cursorSurroundingLinesStyle?: 'default' | 'all';
        /**
         * 當(dāng)文件以換行結(jié)束時(shí)呈現(xiàn)最后一行號 Defaults to true.
        */
        renderFinalNewline?: boolean;
        /**
         * 單擊行號時(shí)是否應(yīng)選擇相應(yīng)的行 Defaults to true.
         */
        selectOnLineNumbers?: boolean;
        /**
         * 控制行號的寬度,至少呈現(xiàn)一定數(shù)量的數(shù)字Defaults to 5.
         */
        lineNumbersMinChars?: number;
        /**
         * 啟用圖示符邊距的渲染 Defaults to true in vscode and to false in monaco-editor.
         */
        glyphMargin?: boolean;
        /**
         * 為行裝飾(行號和編輯器內(nèi)容之間)保留的寬度(px). Defaults to 10.
         */
        lineDecorationsWidth?: number | string;
        /**
         * 當(dāng)顯示光標(biāo)時(shí),會(huì)向光標(biāo)添加一個(gè)虛擬填充(px),將其變成一個(gè)矩形Defaults to 30 (px).
         */
        revealHorizontalRightPadding?: number;
        /**
         * 使用圓角邊框渲染編輯器選擇.Defaults to true.
         */
        roundedSelection?: boolean;
        /**
         * 要添加到編輯器的類名
         */
        extraEditorClassName?: string;
        /**
         * 是否只讀 Defaults to false.
         */
        readOnly?: boolean;
        /**
         * 編輯器是否應(yīng)該呈現(xiàn)驗(yàn)證裝飾。Defaults to editable.
         */
        renderValidationDecorations?: 'editable' | 'on' | 'off';
        /**
         * 控制滾動(dòng)條的行為和呈現(xiàn)--見下方滾動(dòng)條屬性
         */
        scrollbar?: IEditorScrollbarOptions;
        /**
         * 控制小地圖的行為和呈現(xiàn)--見下方小地圖屬性
         */
        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;
        /**
         * 控制光標(biāo)動(dòng)畫樣式, Defaults to 'blink'.
         */
        cursorBlinking?: 'blink' | 'smooth' | 'phase' | 'expand' | 'solid';
        /**
         *使用鼠標(biāo)滾輪并按住Ctrl鍵時(shí),在編輯器中縮放字體。Defaults to false.
         */
        mouseWheelZoom?: boolean;
        /**
         * 控制鼠標(biāo)指針樣式, Defaults to 'text'
         */
        mouseStyle?: 'text' | 'default' | 'copy';
        /**
         * 啟用平滑插入符號動(dòng)畫 Defaults to false.
         */
        cursorSmoothCaretAnimation?: boolean;
        /**
         * 光標(biāo)樣式,  Defaults to 'line'.
         */
        cursorStyle?: 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin';
        /**
         * 當(dāng)cursorStyle設(shè)置為“l(fā)ine”時(shí),控制光標(biāo)的寬度
         */
        cursorWidth?: number;
        /**
         * 設(shè)置font ligatures. Defaults to false.
         */
        fontLigatures?: boolean | string;
        /**
         * 禁止對編輯器邊距和行圖層使用“transform:translate3d(0px,0px,0px)”。
*“transform:translate3d(0px,0px,0px)”的用法可以作為瀏覽器創(chuàng)建額外層的提示。 Defaults to false.
         */
        disableLayerHinting?: boolean;
        /**
         * 是否禁用優(yōu)化 monospace fonts. Defaults to false.
         */
        disableMonospaceOptimizations?: boolean;
        /**
         * 光標(biāo)是否隱藏在概覽標(biāo)尺中 Defaults to false.
         */
        hideCursorInOverviewRuler?: boolean;
        /**
         * 啟用滾動(dòng)可以在最后一行后移動(dòng)一個(gè)屏幕大小  Defaults to true.
         */
        scrollBeyondLastLine?: boolean;
        /**
         * 啟用滾動(dòng)可以超出最后一列的許多列.Defaults to 5.
         */
        scrollBeyondLastColumn?: number;
        /**
         * 編輯器動(dòng)畫效果滾動(dòng)到一個(gè)位置. Defaults to false.
         */
        smoothScrolling?: boolean;
        /**
         * 編輯器將設(shè)置一個(gè)間隔時(shí)間來檢查其dom節(jié)點(diǎn)大小是否已更改。啟用此功能可能會(huì)對性能產(chǎn)生嚴(yán)重影響。
         * Defaults to false.
         */
        automaticLayout?: boolean;
        /**
         * 設(shè)置編輯器的換行.Defaults to "off".
         */
        wordWrap?: 'off' | 'on' | 'wordWrapColumn' | 'bounded';
        /**
         *  wordWrap設(shè)置為wordWrapColumn生效,Defaults to 80.
         */
        wordWrapColumn?: number;
        /**
         * 當(dāng)文本顯示為縮小生成的文件時(shí)強(qiáng)制換行.
         * Defaults to true.
         */
        wordWrapMinified?: boolean;
        /**
         *控制換行的縮進(jìn).Defaults to 'same' in vscode and to 'none' in monaco-editor.
         */
        wrappingIndent?: 'none' | 'same' | 'indent' | 'deepIndent';
        /**
         * 換行策略. Defaults to 'simple'.
         */
        wrappingStrategy?: 'simple' | 'advanced';
        /**
         * 配置換行字符。在這些字符之前將引入一個(gè)中斷 Defaults to '([{‘“〈《「『【〔([{?£¥$£¥++'.
         */
        wordWrapBreakBeforeCharacters?: string;
        /**
         * 配置換行字符。在這些字符之后將引入中斷 Defaults to ' \t})]?|/&.,;¢°′″‰℃、。??¢,.:;??。??ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎ??????????????????々???????????”〉》」』】〕)]}?'.
         */
        wordWrapBreakAfterCharacters?: string;
        /**
         *停止渲染x個(gè)字符后的行 Defaults to 10000. 使用-1永不停止渲染
         */
        stopRenderingLineAfter?: number;
        /**
         * 配置hover.
         */
        hover?: {
          /**
         * 啟用懸停 Defaults to true.
         */
        enabled?: boolean;
        /**
         * 懸停顯示延遲時(shí)間 Defaults to 300.
         */
        delay?: number;
        /**
         * 懸停是否具有便簽,以便可以單擊它并選擇其內(nèi)容 Defaults to true.
         */
        sticky?: boolean;
      };
        /**
         * 啟用檢測鏈接并使其可單擊. Defaults to true.
         */
        links?: boolean;
        /**
         * 啟用內(nèi)聯(lián)顏色裝飾器和顏色選擇器渲染
         */
        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';
}

滾動(dòng)條屬性 IEditorScrollbarOptions

{
        /**
         * 垂直滾動(dòng)條。Defaults to 'auto'.
         */
        vertical?: 'auto' | 'visible' | 'hidden';
        /**
         * 水平滾動(dòng)條.Defaults to 'auto'.
         */
        horizontal?: 'auto' | 'visible' | 'hidden';
        /**
         * 滾動(dòng)內(nèi)容時(shí)投射水平和垂直陰影 Defaults to true.
         */
        useShadows?: boolean;
        /**
         *渲染垂直滾動(dòng)條頂部和底部的箭頭。Defaults to false.
         */
        verticalHasArrows?: boolean;
        /**
         *渲染水平滾動(dòng)條左右兩側(cè)的箭頭 Defaults to false.
         */
        horizontalHasArrows?: boolean;
        /**
         * 箭頭的大小(如果顯示)。 Defaults to 11.
         */
        arrowSize?: number;
        /**
         * 監(jiān)聽鼠標(biāo)滾輪事件并通過滾動(dòng)做出反應(yīng). Defaults to true.
         */
        handleMouseWheel?: boolean;
        /**
         * 總是使用鼠標(biāo)滾輪事件(總是在瀏覽器事件上調(diào)用preventDefault()和stopPropagation()) Defaults to true.
         */
        alwaysConsumeMouseWheel?: boolean;
        /**
         * 水平滾動(dòng)條的高度(px)。Defaults to 10 (px).
         */
        horizontalScrollbarSize?: number;
        /**
         * 垂直滾動(dòng)條的寬度(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;
}
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容