/** * @description 代码预览 */ import React from "react" import { PopModalProps, PopModal, StateManage, Button, PropertyService } from "zion-ui" import Editor from "@monaco-editor/react" const className = "zion-ui-code-container" interface ICodePreview { code?: string modalProps?: PopModalProps language?: string allowPreview?: boolean } export const CodePreview = function (params: ICodePreview) { const { code, modalProps, language, allowPreview } = params const codeEleId = "zion-ui-code-container-" + ((Math.random() * 100000).toFixed(0)) const editorOptions = { "fontSize": 13, "tabSize": 4, "wordWrapColumn": 400, "formatOnSave": true, "renderControlCharacters": false, "detectIndentation": false, "codeDataApiOnSave": { "source.fixAll.eslint": false }, "formatOnPaste": true, } const editorMap: any = { editor: null } const footer =