tmagic-editor/docs/assets/form-config_fields_text.md.TX1l0lwW.js
2025-04-28 12:31:54 +00:00

2 lines
5.3 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{aw as i,ag as l,y as s,z as p,A as d,P as r,b0 as b,L as a,H as n}from"./chunks/framework.BCBheFgR.js";const P=JSON.parse('{"title":"Input 输入框","description":"","frontmatter":{},"headers":[],"relativePath":"form-config/fields/text.md","filePath":"form-config/fields/text.md"}'),u={name:"form-config/fields/text.md"};function m(f,t,h,x,g,k){const e=l("demo-block");return p(),s("div",null,[t[7]||(t[7]=d("h1",{id:"input-输入框",tabindex:"-1"},[a("Input 输入框 "),d("a",{class:"header-anchor",href:"#input-输入框","aria-label":'Permalink to "Input 输入框"'},"")],-1)),t[8]||(t[8]=d("p",null,"通过鼠标或键盘输入字符",-1)),t[9]||(t[9]=d("h2",{id:"基础用法",tabindex:"-1"},[a("基础用法 "),d("a",{class:"header-anchor",href:"#基础用法","aria-label":'Permalink to "基础用法"'},"")],-1)),r(e,{type:"form",config:[{name:"text",text:"输入框"}]},{source:n(()=>t[0]||(t[0]=[d("p",null," Input输入框的type为'text', 是type的默认值所以可以不配置 ",-1)])),_:1}),t[10]||(t[10]=d("h2",{id:"禁用状态",tabindex:"-1"},[a("禁用状态 "),d("a",{class:"header-anchor",href:"#禁用状态","aria-label":'Permalink to "禁用状态"'},"")],-1)),r(e,{type:"form",config:[{name:"text",text:"输入框",disabled:()=>!0}]},{source:n(()=>t[1]||(t[1]=[d("p",null," 通过 disabled 属性指定是否禁用 input 组件 ",-1)])),_:1}),t[11]||(t[11]=d("h2",{id:"复合型输入框",tabindex:"-1"},[a("复合型输入框 "),d("a",{class:"header-anchor",href:"#复合型输入框","aria-label":'Permalink to "复合型输入框"'},"")],-1)),t[12]||(t[12]=d("p",null,"后置内容",-1)),r(e,{type:"form",config:[{name:"text",text:"重量",append:"公斤"}]},{source:n(()=>t[2]||(t[2]=[d("p",null," 可以通过配置append来增加一个后置内容。 ",-1)])),_:1}),r(e,{type:"form",config:[{name:"text",text:"输入框",append:{type:"button",text:"操作",handler:o=>{o.$message(o.mForm.values.text)}}}]},{source:n(()=>t[3]||(t[3]=[d("p",null," 可以通过配置append来增加一个后置按钮。 ",-1)])),_:1},8,["config"]),t[13]||(t[13]=d("h2",{id:"过滤内容",tabindex:"-1"},[a("过滤内容 "),d("a",{class:"header-anchor",href:"#过滤内容","aria-label":'Permalink to "过滤内容"'},"")],-1)),r(e,{type:"form",config:[{name:"text",text:"输入框",filter:"number"}]},{source:n(()=>t[4]||(t[4]=[d("p",null," 设置filter为'number',可以将值转换成数值,也可以配置一个函数来自由转换。 ",-1)])),_:1}),t[14]||(t[14]=d("h2",{id:"去掉首尾空格",tabindex:"-1"},[a("去掉首尾空格 "),d("a",{class:"header-anchor",href:"#去掉首尾空格","aria-label":'Permalink to "去掉首尾空格"'},"")],-1)),r(e,{type:"form",config:[{name:"text",text:"输入框",trim:!0}]},{source:n(()=>t[5]||(t[5]=[d("p",null," 设置trim为true',可以去掉首尾空格。 ",-1)])),_:1}),t[15]||(t[15]=d("h2",{id:"显示详情",tabindex:"-1"},[a("显示详情 "),d("a",{class:"header-anchor",href:"#显示详情","aria-label":'Permalink to "显示详情"'},"")],-1)),r(e,{type:"form",config:[{name:"text",text:"输入框",tooltip:!0}]},{source:n(()=>t[6]||(t[6]=[d("p",null," 在开启多选模式后默认情况下会展示所有已选中的选项的Tag ",-1)])),_:1}),t[16]||(t[16]=b('<h2 id="input-attributes" tabindex="-1">Input Attributes <a class="header-anchor" href="#input-attributes" aria-label="Permalink to &quot;Input Attributes&quot;"></a></h2><table tabindex="0"><thead><tr><th>参数</th><th>说明</th><th>类型</th><th>可选值</th><th>默认值</th></tr></thead><tbody><tr><td>name</td><td>绑定值</td><td>string</td><td>—</td><td>—</td></tr><tr><td>placeholder</td><td>输入框占位文本</td><td>string</td><td>—</td><td>—</td></tr><tr><td>text</td><td>表单标签</td><td>string</td><td>—</td><td>—</td></tr><tr><td>disabled</td><td>是否禁用</td><td>boolean / <a href="https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts" target="_blank" rel="noreferrer">FilterFunction</a></td><td>—</td><td>false</td></tr><tr><td>tooltip</td><td>输入时显示内容</td><td>boolean</td><td>—</td><td>false</td></tr><tr><td>placeholder</td><td>输入框占位文本</td><td>string</td><td>—</td><td>—</td></tr><tr><td>trim</td><td>是否去掉首尾空格</td><td>boolean</td><td>—</td><td>false</td></tr><tr><td>filter</td><td>过滤值</td><td>string / Function</td><td>number</td><td>-</td></tr><tr><td>onChange</td><td>值变化时触发的函数</td><td><a href="https://github.com/Tencent/tmagic-editor/blob/master/packages/form/src/schema.ts" target="_blank" rel="noreferrer">OnChangeHandler </a></td><td>—</td><td>-</td></tr><tr><td>append</td><td>后置内容</td><td>string / Object</td><td>—</td><td>-</td></tr></tbody></table><h2 id="append-attributes" tabindex="-1">append Attributes <a class="header-anchor" href="#append-attributes" aria-label="Permalink to &quot;append Attributes&quot;"></a></h2><table tabindex="0"><thead><tr><th>参数</th><th>说明</th><th>类型</th><th>可选值</th><th>默认值</th></tr></thead><tbody><tr><td>type</td><td>内容类型</td><td>string</td><td>button</td><td>—</td></tr><tr><td>text</td><td>文本内容</td><td>string</td><td>—</td><td>—</td></tr><tr><td>handler</td><td>点击操作</td><td>Function</td><td>—</td><td>-</td></tr></tbody></table>',4))])}const T=i(u,[["render",m]]);export{P as __pageData,T as default};