我是靠谱客的博主 勤劳冰棍,这篇文章主要介绍freemarker ftl 文件中写radio单选框select 下拉框并且带if条件判断,现在分享给大家,希望可以做个参考。

<#list themes as t>
                  <#switch t.id>
                <#case "default">
   <input name="console-options-theme-menu"  type="radio" <#if  t.selected> checked </#if> value="${t.id}">蓝色主题
                   <#break>
               <#case "gdocs">
   <input name="console-options-theme-menu"  type="radio" <#if  t.selected> checked </#if> value="${t.id}">淡蓝主题
                   <#break>
   <#case "greenTheme">
   <input name="console-options-theme-menu"  type="radio" <#if  t.selected> checked </#if> value="${t.id}">绿色主题
                   <#break>
   <#case "hcBlack">                       
   <input name="console-options-theme-menu"  type="radio" <#if  t.selected> checked </#if> value="${t.id}">黑色主题
                   <#break>
   <#case "yellowTheme">                       
   <input name="console-options-theme-menu"  type="radio" <#if  t.selected> checked </#if> value="${t.id}">黄色主题
                   <#break>
                        <#default>
   <input name="console-options-theme-menu"  type="radio" <#if  t.selected> checked </#if> value="${t.id}">${t.title?html}${t.id?html}1
   </#switch>
                  </#list>
 
下拉框
 
<select id="console-options-theme-menu">
                  <#list themes as t>
                  <#switch t.id>
                <#case "default">
                        <option value="${t.id}"<#if t.selected> selected="selected"</#if>>蓝色主题</option>
                   <#break>
               <#case "gdocs">
                        <option value="${t.id}"<#if t.selected> selected="selected"</#if>>淡蓝主题</option>
                   <#break>
   <#case "greenTheme">
                        <option value="${t.id}"<#if t.selected> selected="selected"</#if>>绿色主题</option>
                   <#break>
   <#case "hcBlack">
                        <option value="${t.id}"<#if t.selected> selected="selected"</#if>>黑色主题</option>
                   <#break>
   <#case "yellowTheme">
                        <option value="${t.id}"<#if t.selected> selected="selected"</#if>>黄色主题</option>
                   <#break>
                        <#default>
                   <option value="${t.id}"<#if t.selected> selected="selected"</#if>>${t.title?html}${t.id?html}1</option>
              
             </#switch>
                  </#list>
               </select>

最后

以上就是勤劳冰棍最近收集整理的关于freemarker ftl 文件中写radio单选框select 下拉框并且带if条件判断的全部内容,更多相关freemarker内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(91)

评论列表共有 0 条评论

立即
投稿
返回
顶部