import{aw as o,ag as s,y as n,z as l,A as e,P as d,b0 as h,L as a,H as i}from"./chunks/framework.BCBheFgR.js";const v=JSON.parse('{"title":"Switch 开关","description":"","frontmatter":{},"headers":[],"relativePath":"form-config/fields/switch.md","filePath":"form-config/fields/switch.md"}'),c={name:"form-config/fields/switch.md"};function m(b,t,f,u,p,w){const r=s("demo-block");return l(),n("div",null,[t[2]||(t[2]=e("h1",{id:"switch-开关",tabindex:"-1"},[a("Switch 开关 "),e("a",{class:"header-anchor",href:"#switch-开关","aria-label":'Permalink to "Switch 开关"'},"​")],-1)),t[3]||(t[3]=e("p",null,"表示两种相互对立的状态间的切换，多用于触发「开/关」。",-1)),t[4]||(t[4]=e("h2",{id:"基本用法",tabindex:"-1"},[a("基本用法 "),e("a",{class:"header-anchor",href:"#基本用法","aria-label":'Permalink to "基本用法"'},"​")],-1)),d(r,{type:"form",config:[{type:"switch",name:"switch",text:"开关"}]}),t[5]||(t[5]=e("h2",{id:"扩展的-value-类型",tabindex:"-1"},[a("扩展的 value 类型 "),e("a",{class:"header-anchor",href:"#扩展的-value-类型","aria-label":'Permalink to "扩展的 value 类型"'},"​")],-1)),d(r,{type:"form",config:[{type:"switch",name:"switch",text:"开关",activeValue:"on",inactiveValue:"off"}]},{source:i(()=>t[0]||(t[0]=[e("p",null," 设置 activeValue 和 inactiveValue 属性，接受 Boolean , String 或 Number 类型的值。 ",-1)])),_:1}),t[6]||(t[6]=e("h2",{id:"禁用状态",tabindex:"-1"},[a("禁用状态 "),e("a",{class:"header-anchor",href:"#禁用状态","aria-label":'Permalink to "禁用状态"'},"​")],-1)),d(r,{type:"form",config:[{type:"switch",name:"switch",text:"开关",disabled:!0}]},{source:i(()=>t[1]||(t[1]=[e("p",null," 设置 disabled 属性，接受一个 Boolean，设置 true 即可禁用。 ",-1)])),_:1}),t[7]||(t[7]=h('<h2 id="attributes" tabindex="-1">Attributes <a class="header-anchor" href="#attributes" aria-label="Permalink to &quot;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>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">Function</a></td><td>—</td><td>false</td></tr><tr><td>active-value</td><td>switch 打开时的值</td><td>boolean / string / number</td><td>—</td><td>true</td></tr><tr><td>inactive-value</td><td>switch 关闭时的值</td><td>boolean / string / number</td><td>—</td><td>false</td></tr></tbody></table>',2))])}const x=o(c,[["render",m]]);export{v as __pageData,x as default};
