mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-05 07:27:09 +08:00
2 lines
2.4 KiB
JavaScript
2 lines
2.4 KiB
JavaScript
import{aw as n,ag as s,y as i,z as l,A as e,P as a,b0 as b,L as d,H as o}from"./chunks/framework.BCBheFgR.js";const g=JSON.parse('{"title":"Checkbox 多选框","description":"","frontmatter":{},"headers":[],"relativePath":"form-config/fields/checkbox.md","filePath":"form-config/fields/checkbox.md"}'),h={name:"form-config/fields/checkbox.md"};function c(m,t,u,x,k,f){const r=s("demo-block");return l(),i("div",null,[t[3]||(t[3]=e("h1",{id:"checkbox-多选框",tabindex:"-1"},[d("Checkbox 多选框 "),e("a",{class:"header-anchor",href:"#checkbox-多选框","aria-label":'Permalink to "Checkbox 多选框"'},"")],-1)),t[4]||(t[4]=e("p",null,"一组备选项中进行多选",-1)),t[5]||(t[5]=e("h2",{id:"基础用法",tabindex:"-1"},[d("基础用法 "),e("a",{class:"header-anchor",href:"#基础用法","aria-label":'Permalink to "基础用法"'},"")],-1)),t[6]||(t[6]=e("p",null,"单独使用可以表示两种状态之间的切换。",-1)),a(r,{type:"form",config:[{type:"checkbox",name:"checkbox",text:"选项"}]},{source:o(()=>t[0]||(t[0]=[e("p",null," 要使用 Checkbox 组件,只需要配置type: 'checkbox',选中意味着变量的值为true。默认绑定变量的值会是 Boolean ,选中为 true 。 ",-1)])),_:1}),t[7]||(t[7]=e("h2",{id:"禁用状态",tabindex:"-1"},[d("禁用状态 "),e("a",{class:"header-anchor",href:"#禁用状态","aria-label":'Permalink to "禁用状态"'},"")],-1)),t[8]||(t[8]=e("p",null,"多选框不可用状态。",-1)),a(r,{type:"form",config:[{type:"checkbox",name:"checkbox",text:"选项",disabled:()=>!0}]},{source:o(()=>t[1]||(t[1]=[e("p",null," 设置 disabled 属性即可,它接受一个 Boolean , true 为禁用,也可以接受一个返回 Boolean 的函数。 ",-1)])),_:1}),t[9]||(t[9]=e("h2",{id:"多选框组",tabindex:"-1"},[d("多选框组 "),e("a",{class:"header-anchor",href:"#多选框组","aria-label":'Permalink to "多选框组"'},"")],-1)),t[10]||(t[10]=e("p",null,"适用于多个勾选框绑定到同一个数组的情景,通过是否勾选来表示这一组选项中选中的项。",-1)),a(r,{type:"form",config:[{type:"checkbox-group",name:"checkbox",text:"选项",options:[{text:"选项1",value:1},{text:"选项2",value:2}]}]},{source:o(()=>t[2]||(t[2]=[e("p",null," checkbox-group 元素能把多个 checkbox 管理为一组。 ",-1)])),_:1}),t[11]||(t[11]=b("",4))])}const C=n(h,[["render",c]]);export{g as __pageData,C as default};
|