🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# checkbox 复选 ## checkbox 复选 ![](https://img.kancloud.cn/eb/9e/eb9ec49098dbe88cda07d6dace2b94fc_808x761.png) 生成效果 ![](https://img.kancloud.cn/22/72/22720db052954686ef5f1cb97f68bc2a_304x43.png) ## 长度 这里并不需要填写长度,数据库将生成set类型。 ## 选项列表 格式如下: key1|标题 1 key2|标题2 左边是保存到数据库的值,右边是单选控件显示的名称,以 英文 “|” 符号分隔 ## 默认值 默认值填写后,将会默认选,如上,默认值填写 **key2**,在进入页面后默认选中了key2,选中多个英文逗号分隔,key1,key2 ## 模板获取 复选的值在模板是一维数组 假设变量是$Info ``` <pre class="calibre16">``` <span class="token3">1.</span> 循环输出,字段名称是你增加的字段名 <span class="token1">{</span>hkcms<span class="token1">:</span>volist name<span class="token">=</span><span class="token4">"$Info['字段名称']"</span> id<span class="token">=</span><span class="token4">"item"</span><span class="token1">}</span> <span class="token"><</span>p<span class="token">></span><span class="token1">{</span>$item<span class="token1">}</span><span class="token"><</span><span class="token">/</span>p<span class="token">></span> <span class="token1">{</span><span class="token">/</span>hkcms<span class="token1">:</span>volist<span class="token1">}</span> <span class="token3">2.</span> 给定元素输出 <span class="token1">{</span>$Info<span class="token1">[</span><span class="token4">'字段名称'</span><span class="token1">]</span><span class="token1">[</span><span class="token3">0</span><span class="token1">]</span><span class="token1">}</span> <span class="token3">3.</span> 数组转字符<span class="token1">,</span>以逗号分隔 <span class="token1">{</span><span class="token1">:</span><span class="token6">explode</span><span class="token1">(</span><span class="token4">','</span><span class="token1">,</span>$Info<span class="token1">[</span><span class="token4">'字段名称'</span><span class="token1">]</span><span class="token1">)</span><span class="token1">}</span> ``` ``` - 其他说明、参考text 单行文本