import{ax as t,z as i,A as a,b2 as e}from"./chunks/framework.DkLJC2NO.js";const E=JSON.parse('{"title":"Code 代码编辑器","description":"","frontmatter":{},"headers":[],"relativePath":"form-config/editor-fields/code.md","filePath":"form-config/editor-fields/code.md"}'),n={name:"form-config/editor-fields/code.md"};function d(h,s,l,p,r,k){return a(),i("div",null,[...s[0]||(s[0]=[e(`

Code 代码编辑器

代码编辑器字段,用于编辑代码内容。

注意

此组件仅在编辑器环境中可用,需要配合 @tmagic/editor 使用。

基础用法

js
{
  type: 'code',
  name: 'code',
  text: '代码'
}

指定语言

js
{
  type: 'code',
  name: 'code',
  text: '代码',
  language: 'javascript'
}

自动调整大小

js
{
  type: 'code',
  name: 'code',
  text: '代码',
  autosize: {
    minRows: 3,
    maxRows: 10
  }
}

Attributes

参数说明类型可选值默认值
name绑定值string
text表单标签string
disabled是否禁用boolean / FilterFunctionfalse
language代码语言stringjavascript/typescript/json等
height编辑器高度string
parse是否解析代码booleanfalse
options编辑器配置项object
autosize自动调整大小配置object
onChange值变化时触发的函数OnChangeHandler-

autosize Attributes

参数说明类型可选值默认值
minRows最小行数number
maxRows最大行数number
`,13)])])}const c=t(n,[["render",d]]);export{E as __pageData,c as default};